SqlContentEntityStorageSchema::createDedicatedTableSchema

protected SqlContentEntityStorageSchema::createDedicatedTableSchema(FieldStorageDefinitionInterface $storage_definition)

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.

File

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

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);
}
doc_Drupal
2016-10-29 09:43:35
Comments
Leave a Comment

Please login to continue.