You are here

public function EntityFieldManager::getActiveFieldStorageDefinitions in Drupal 9

Same name and namespace in other branches
  1. 8 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 480

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);
}