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
1 2 3 4 5 6 7 8 9 10 11 | 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 ); } |
Please login to continue.