function SqlContentEntityStorageSchema::performFieldSchemaOperation

Same name in other branches
  1. 9 core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php \Drupal\Core\Entity\Sql\SqlContentEntityStorageSchema::performFieldSchemaOperation()
  2. 8.9.x core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php \Drupal\Core\Entity\Sql\SqlContentEntityStorageSchema::performFieldSchemaOperation()
  3. 10 core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php \Drupal\Core\Entity\Sql\SqlContentEntityStorageSchema::performFieldSchemaOperation()

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.

6 calls to SqlContentEntityStorageSchema::performFieldSchemaOperation()
SqlContentEntityStorageSchema::finalizePurge in core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php
Performs final cleanup after all data of a field has been purged.
SqlContentEntityStorageSchema::onFieldStorageDefinitionCreate in core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php
Reacts to the creation of a field storage definition.
SqlContentEntityStorageSchema::onFieldStorageDefinitionDelete in core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php
Reacts to the deletion of a field storage definition.
SqlContentEntityStorageSchema::onFieldStorageDefinitionUpdate in core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php
Reacts to the update of a field storage definition.
SqlContentEntityStorageSchema::updateDedicatedTableSchema in core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php
Updates the schema for a field stored in a shared table.

... See full list

File

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

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->getTableMapping($this->entityType, [
        $storage_definition,
    ]);
    if ($table_mapping->requiresDedicatedTableStorage($storage_definition)) {
        $this->{$operation . 'DedicatedTableSchema'}($storage_definition, $original);
    }
    elseif ($table_mapping->allowsSharedTableStorage($storage_definition)) {
        $this->{$operation . 'SharedTableSchema'}($storage_definition, $original);
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.