You are here

public function SqlContentEntityStorage::onFieldStorageDefinitionUpdate in Drupal 9

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php \Drupal\Core\Entity\Sql\SqlContentEntityStorage::onFieldStorageDefinitionUpdate()
  2. 10 core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php \Drupal\Core\Entity\Sql\SqlContentEntityStorage::onFieldStorageDefinitionUpdate()

Reacts to the update of a field storage definition.

Parameters

\Drupal\Core\Field\FieldStorageDefinitionInterface $storage_definition: The field being updated.

\Drupal\Core\Field\FieldStorageDefinitionInterface $original: The original storage definition; i.e., the definition before the update.

Throws

\Drupal\Core\Entity\Exception\FieldStorageDefinitionUpdateForbiddenException Thrown when the update to the field is forbidden.

Overrides ContentEntityStorageBase::onFieldStorageDefinitionUpdate

File

core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php, line 1532

Class

SqlContentEntityStorage
A content entity database storage implementation.

Namespace

Drupal\Core\Entity\Sql

Code

public function onFieldStorageDefinitionUpdate(FieldStorageDefinitionInterface $storage_definition, FieldStorageDefinitionInterface $original) {
  $this
    ->wrapSchemaException(function () use ($storage_definition, $original) {
    $this
      ->getStorageSchema()
      ->onFieldStorageDefinitionUpdate($storage_definition, $original);
    $this->fieldStorageDefinitions[$storage_definition
      ->getName()] = $storage_definition;
    $this->tableMapping = NULL;
  });
}