SqlContentEntityStorageSchema::onFieldStorageDefinitionUpdate

public SqlContentEntityStorageSchema::onFieldStorageDefinitionUpdate(FieldStorageDefinitionInterface $storage_definition, FieldStorageDefinitionInterface $original)

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 FieldStorageDefinitionListenerInterface::onFieldStorageDefinitionUpdate

File

core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php, line 392

Class

SqlContentEntityStorageSchema
Defines a schema handler that supports revisionable, translatable entities.

Namespace

Drupal\Core\Entity\Sql

Code

public function onFieldStorageDefinitionUpdate(FieldStorageDefinitionInterface $storage_definition, FieldStorageDefinitionInterface $original) {
  // Store original definitions so that switching between shared and dedicated
  // field table layout works.
  $this->originalDefinitions = $this->fieldStorageDefinitions;
  $this->originalDefinitions[$original->getName()] = $original;
  $this->performFieldSchemaOperation('update', $storage_definition, $original);
  $this->originalDefinitions = NULL;
}
doc_Drupal
2016-10-29 09:43:43
Comments
Leave a Comment

Please login to continue.