You are here

public function EntityLastInstalledSchemaRepository::setLastInstalledFieldStorageDefinition in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/lib/Drupal/Core/Entity/EntityLastInstalledSchemaRepository.php \Drupal\Core\Entity\EntityLastInstalledSchemaRepository::setLastInstalledFieldStorageDefinition()

Stores the field storage definition in the application state.

Parameters

\Drupal\Core\Field\FieldStorageDefinitionInterface $storage_definition: The field storage definition.

Overrides EntityLastInstalledSchemaRepositoryInterface::setLastInstalledFieldStorageDefinition

File

core/lib/Drupal/Core/Entity/EntityLastInstalledSchemaRepository.php, line 80
Contains \Drupal\Core\Entity\EntityLastInstalledSchemaRepository.

Class

EntityLastInstalledSchemaRepository
Provides a repository for installed entity definitions.

Namespace

Drupal\Core\Entity

Code

public function setLastInstalledFieldStorageDefinition(FieldStorageDefinitionInterface $storage_definition) {
  $entity_type_id = $storage_definition
    ->getTargetEntityTypeId();
  $definitions = $this
    ->getLastInstalledFieldStorageDefinitions($entity_type_id);
  $definitions[$storage_definition
    ->getName()] = $storage_definition;
  $this
    ->setLastInstalledFieldStorageDefinitions($entity_type_id, $definitions);
}