SqlContentEntityStorage::onFieldStorageDefinitionCreate

public SqlContentEntityStorage::onFieldStorageDefinitionCreate(FieldStorageDefinitionInterface $storage_definition)

Reacts to the creation of a field storage definition.

Parameters

\Drupal\Core\Field\FieldStorageDefinitionInterface $storage_definition: The definition being created.

Overrides ContentEntityStorageBase::onFieldStorageDefinitionCreate

File

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

Class

SqlContentEntityStorage
A content entity database storage implementation.

Namespace

Drupal\Core\Entity\Sql

Code

public function onFieldStorageDefinitionCreate(FieldStorageDefinitionInterface $storage_definition) {
  // If we are adding a field stored in a shared table we need to recompute
  // the table mapping.
  // @todo This does not belong here. Remove it once we are able to generate a
  //   fresh table mapping in the schema handler. See
  //   https://www.drupal.org/node/2274017.
  if ($this->getTableMapping()->allowsSharedTableStorage($storage_definition)) {
    $this->tableMapping = NULL;
  }
  $this->wrapSchemaException(function() use ($storage_definition) {
    $this->getStorageSchema()->onFieldStorageDefinitionCreate($storage_definition);
  });
}
doc_Drupal
2016-10-29 09:43:27
Comments
Leave a Comment

Please login to continue.