You are here

protected function SqlContentEntityStorageSchema::createDedicatedTableSchema in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php \Drupal\Core\Entity\Sql\SqlContentEntityStorageSchema::createDedicatedTableSchema()

Creates the schema for a field stored in a dedicated table.

Parameters

\Drupal\Core\Field\FieldStorageDefinitionInterface $storage_definition: The storage definition of the field being created.

1 call to SqlContentEntityStorageSchema::createDedicatedTableSchema()
SqlContentEntityStorageSchema::onEntityTypeCreate in core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php
Reacts to the creation of the entity type.

File

core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php, line 1106
Contains \Drupal\Core\Entity\Sql\SqlContentEntityStorageSchema.

Class

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

Namespace

Drupal\Core\Entity\Sql

Code

protected function createDedicatedTableSchema(FieldStorageDefinitionInterface $storage_definition) {
  $schema = $this
    ->getDedicatedTableSchema($storage_definition);
  foreach ($schema as $name => $table) {

    // Check if the table exists because it might already have been
    // created as part of the earlier entity type update event.
    if (!$this->database
      ->schema()
      ->tableExists($name)) {
      $this->database
        ->schema()
        ->createTable($name, $table);
    }
  }
  $this
    ->saveFieldSchemaData($storage_definition, $schema);
}