protected function SqlContentEntityStorageSchema::performFieldSchemaOperation

protected SqlContentEntityStorageSchema::performFieldSchemaOperation($operation, FieldStorageDefinitionInterface $storage_definition, FieldStorageDefinitionInterface $original = NULL)

Performs the specified operation on a field.

This figures out whether the field is stored in a dedicated or shared table and forwards the call to the proper handler.

Parameters

string $operation: The name of the operation to be performed.

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

\Drupal\Core\Field\FieldStorageDefinitionInterface $original: (optional) The original field storage definition. This is relevant (and required) only for updates. Defaults to NULL.

File

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

Class

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

Namespace

Drupal\Core\Entity\Sql

Code

protected function performFieldSchemaOperation($operation, FieldStorageDefinitionInterface $storage_definition, FieldStorageDefinitionInterface $original = NULL) {
  $table_mapping = $this->storage->getTableMapping();
  if ($table_mapping->requiresDedicatedTableStorage($storage_definition)) {
    $this->{$operation . 'DedicatedTableSchema'}($storage_definition, $original);
  }
  elseif ($table_mapping->allowsSharedTableStorage($storage_definition)) {
    $this->{$operation . 'SharedTableSchema'}($storage_definition, $original);
  }
}

© 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!SqlContentEntityStorageSchema.php/function/SqlContentEntityStorageSchema::performFieldSchemaOperation/8.1.x