function EntityFieldManager::getActiveFieldStorageDefinitions

Same name in other branches
  1. 9 core/lib/Drupal/Core/Entity/EntityFieldManager.php \Drupal\Core\Entity\EntityFieldManager::getActiveFieldStorageDefinitions()
  2. 8.9.x core/lib/Drupal/Core/Entity/EntityFieldManager.php \Drupal\Core\Entity\EntityFieldManager::getActiveFieldStorageDefinitions()
  3. 11.x core/lib/Drupal/Core/Entity/EntityFieldManager.php \Drupal\Core\Entity\EntityFieldManager::getActiveFieldStorageDefinitions()

Gets the active field storage definitions for a content entity type.

@internal

Parameters

string $entity_type_id: The entity type ID. Only content entities are supported.

Return value

\Drupal\Core\Field\FieldStorageDefinitionInterface[] An array of field storage definitions that are active in the current request, keyed by field name.

File

core/lib/Drupal/Core/Entity/EntityFieldManager.php, line 486

Class

EntityFieldManager
Manages the discovery of entity fields.

Namespace

Drupal\Core\Entity

Code

public function getActiveFieldStorageDefinitions($entity_type_id) {
    if (!isset($this->activeFieldStorageDefinitions[$entity_type_id])) {
        $this->activeFieldStorageDefinitions[$entity_type_id] = $this->entityLastInstalledSchemaRepository
            ->getLastInstalledFieldStorageDefinitions($entity_type_id);
    }
    return $this->activeFieldStorageDefinitions[$entity_type_id] ?: $this->getFieldStorageDefinitions($entity_type_id);
}

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