function FieldViewsDataProvider::getSqlStorageForField

Determines whether the entity type the field appears in is SQL based.

Parameters

\Drupal\field\FieldStorageConfigInterface $field_storage: The field storage definition.

Return value

\Drupal\Core\Entity\Sql\SqlContentEntityStorage|bool Returns the entity type storage if supported and FALSE otherwise.

1 call to FieldViewsDataProvider::getSqlStorageForField()
FieldViewsDataProvider::defaultFieldImplementation in core/modules/views/src/FieldViewsDataProvider.php
Default views data implementation for a field.

File

core/modules/views/src/FieldViewsDataProvider.php, line 511

Class

FieldViewsDataProvider
Provide default views data for fields.

Namespace

Drupal\views

Code

public function getSqlStorageForField(FieldStorageConfigInterface $field_storage) : SqlContentEntityStorage|bool {
    $result = FALSE;
    if ($this->entityTypeManager
        ->hasDefinition($field_storage->getTargetEntityTypeId())) {
        $storage = $this->entityTypeManager
            ->getStorage($field_storage->getTargetEntityTypeId());
        $result = $storage instanceof SqlContentEntityStorage ? $storage : FALSE;
    }
    return $result;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.