W3cubDocs

/Drupal 8

public function 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 1387

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

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Entity!Sql!SqlContentEntityStorage.php/function/SqlContentEntityStorage::onFieldStorageDefinitionCreate/8.1.x