function EntityFieldManager::getActiveFieldStorageDefinitions

Same name in other branches
  1. 9 core/lib/Drupal/Core/Entity/EntityFieldManager.php \Drupal\Core\Entity\EntityFieldManager::getActiveFieldStorageDefinitions()
  2. 10 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 468

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->keyValueFactory
            ->get('entity.definitions.installed')
            ->get($entity_type_id . '.field_storage_definitions', []);
    }
    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.