Drupal 8  8.0.2
SqlContentEntityStorageSchema Class Reference
Inheritance diagram for SqlContentEntityStorageSchema:

Public Member Functions

 __construct (EntityManagerInterface $entity_manager, ContentEntityTypeInterface $entity_type, SqlContentEntityStorage $storage, Connection $database)
 
 requiresEntityStorageSchemaChanges (EntityTypeInterface $entity_type, EntityTypeInterface $original)
 
 requiresFieldStorageSchemaChanges (FieldStorageDefinitionInterface $storage_definition, FieldStorageDefinitionInterface $original)
 
 requiresEntityDataMigration (EntityTypeInterface $entity_type, EntityTypeInterface $original)
 
 requiresFieldDataMigration (FieldStorageDefinitionInterface $storage_definition, FieldStorageDefinitionInterface $original)
 
 onEntityTypeCreate (EntityTypeInterface $entity_type)
 
 onEntityTypeUpdate (EntityTypeInterface $entity_type, EntityTypeInterface $original)
 
 onEntityTypeDelete (EntityTypeInterface $entity_type)
 
 onFieldStorageDefinitionCreate (FieldStorageDefinitionInterface $storage_definition)
 
 onFieldStorageDefinitionUpdate (FieldStorageDefinitionInterface $storage_definition, FieldStorageDefinitionInterface $original)
 
 onFieldStorageDefinitionDelete (FieldStorageDefinitionInterface $storage_definition)
 
 finalizePurge (FieldStorageDefinitionInterface $storage_definition)
 

Protected Member Functions

 installedStorageSchema ()
 
 hasSharedTableStructureChange (EntityTypeInterface $entity_type, EntityTypeInterface $original)
 
 hasSharedTableNameChanges (EntityTypeInterface $entity_type, EntityTypeInterface $original)
 
 getSchemaFromStorageDefinition (FieldStorageDefinitionInterface $storage_definition)
 
 checkEntityType (EntityTypeInterface $entity_type)
 
 getEntitySchema (ContentEntityTypeInterface $entity_type, $reset=FALSE)
 
 getEntitySchemaTables ()
 
 getEntitySchemaData (ContentEntityTypeInterface $entity_type, array $schema)
 
 getFieldIndexes ($field_name, array $field_schema, array $column_mapping)
 
 getFieldUniqueKeys ($field_name, array $field_schema, array $column_mapping)
 
 getFieldSchemaData ($field_name, array $field_schema, array $column_mapping, $schema_key)
 
 getFieldSchemaIdentifierName ($entity_type_id, $field_name, $key=NULL)
 
 getFieldForeignKeys ($field_name, array $field_schema, array $column_mapping)
 
 loadEntitySchemaData (EntityTypeInterface $entity_type)
 
 saveEntitySchemaData (EntityTypeInterface $entity_type, $schema)
 
 deleteEntitySchemaData (EntityTypeInterface $entity_type)
 
 loadFieldSchemaData (FieldStorageDefinitionInterface $storage_definition)
 
 saveFieldSchemaData (FieldStorageDefinitionInterface $storage_definition, $schema)
 
 deleteFieldSchemaData (FieldStorageDefinitionInterface $storage_definition)
 
 initializeBaseTable (ContentEntityTypeInterface $entity_type)
 
 initializeRevisionTable (ContentEntityTypeInterface $entity_type)
 
 initializeDataTable (ContentEntityTypeInterface $entity_type)
 
 initializeRevisionDataTable (ContentEntityTypeInterface $entity_type)
 
 addTableDefaults (&$schema)
 
 processBaseTable (ContentEntityTypeInterface $entity_type, array &$schema)
 
 processRevisionTable (ContentEntityTypeInterface $entity_type, array &$schema)
 
 processDataTable (ContentEntityTypeInterface $entity_type, array &$schema)
 
 processRevisionDataTable (ContentEntityTypeInterface $entity_type, array &$schema)
 
 processIdentifierSchema (&$schema, $key)
 
 performFieldSchemaOperation ($operation, FieldStorageDefinitionInterface $storage_definition, FieldStorageDefinitionInterface $original=NULL)
 
 createDedicatedTableSchema (FieldStorageDefinitionInterface $storage_definition)
 
 createSharedTableSchema (FieldStorageDefinitionInterface $storage_definition, $only_save=FALSE)
 
 deleteDedicatedTableSchema (FieldStorageDefinitionInterface $storage_definition)
 
 deleteSharedTableSchema (FieldStorageDefinitionInterface $storage_definition)
 
 updateDedicatedTableSchema (FieldStorageDefinitionInterface $storage_definition, FieldStorageDefinitionInterface $original)
 
 updateSharedTableSchema (FieldStorageDefinitionInterface $storage_definition, FieldStorageDefinitionInterface $original)
 
 createEntitySchemaIndexes (array $entity_schema, FieldStorageDefinitionInterface $storage_definition=NULL)
 
 deleteEntitySchemaIndexes (array $entity_schema_data, FieldStorageDefinitionInterface $storage_definition=NULL)
 
 hasNullFieldPropertyData ($table_name, $column_name)
 
 getSharedTableFieldSchema (FieldStorageDefinitionInterface $storage_definition, $table_name, array $column_mapping)
 
 addSharedTableFieldIndex (FieldStorageDefinitionInterface $storage_definition, &$schema, $not_null=FALSE, $size=NULL)
 
 addSharedTableFieldUniqueKey (FieldStorageDefinitionInterface $storage_definition, &$schema)
 
 addSharedTableFieldForeignKey (FieldStorageDefinitionInterface $storage_definition, &$schema, $foreign_table, $foreign_column)
 
 getDedicatedTableSchema (FieldStorageDefinitionInterface $storage_definition, ContentEntityTypeInterface $entity_type=NULL)
 
 getEntityIndexName (ContentEntityTypeInterface $entity_type, $index)
 
 getFieldIndexName (FieldStorageDefinitionInterface $storage_definition, $index)
 
 isTableEmpty ($table_name)
 
 hasColumnChanges (FieldStorageDefinitionInterface $storage_definition, FieldStorageDefinitionInterface $original)
 
 getColumnSchemaRelevantKeys ()
 
 addIndex ($table, $name, array $specifier, array $schema)
 
 addUniqueKey ($table, $name, array $specifier)
 

Protected Attributes

 $entityManager
 
 $entityType
 
 $fieldStorageDefinitions
 
 $originalDefinitions
 
 $storage
 
 $schema
 
 $database
 
 $installedStorageSchema
 

Detailed Description

Defines a schema handler that supports revisionable, translatable entities.

Entity types may extend this class and optimize the generated schema for all entity base tables by overriding getEntitySchema() for cross-field optimizations and getSharedTableFieldSchema() for optimizations applying to a single field.

Constructor & Destructor Documentation

__construct ( EntityManagerInterface  $entity_manager,
ContentEntityTypeInterface  $entity_type,
SqlContentEntityStorage  $storage,
Connection  $database 
)

Constructs a SqlContentEntityStorageSchema.

Parameters
\Drupal\Core\Entity\EntityManagerInterface$entity_managerThe entity manager.
\Drupal\Core\Entity\ContentEntityTypeInterface$entity_typeThe entity type.
\Drupal\Core\Entity\Sql\SqlContentEntityStorage$storageThe storage of the entity type. This must be an SQL-based storage.
\Drupal\Core\Database\Connection$databaseThe database connection to be used.

References Drupal\database(), Drupal\entityManager(), EntityFieldManagerInterface\getFieldStorageDefinitions(), and EntityTypeInterface\id().

Here is the call graph for this function:

Member Function Documentation

addIndex (   $table,
  $name,
array  $specifier,
array  $schema 
)
protected

Creates an index, dropping it if already existing.

Parameters
string$tableThe table name.
string$nameThe index name.
array$specifierThe fields to index.
array$schemaThe table specification.
See Also
::addIndex()

References Drupal\database().

Referenced by SqlContentEntityStorageSchema\createSharedTableSchema(), SqlContentEntityStorageSchema\updateDedicatedTableSchema(), and SqlContentEntityStorageSchema\updateSharedTableSchema().

Here is the call graph for this function:

Here is the caller graph for this function:

addSharedTableFieldForeignKey ( FieldStorageDefinitionInterface  $storage_definition,
$schema,
  $foreign_table,
  $foreign_column 
)
protected

Adds a foreign key for the specified field to the given schema definition.

Parameters
\Drupal\Core\Field\FieldStorageDefinitionInterface$storage_definitionThe storage definition of the field to which to add a foreign key.
array$schemaA reference to the schema array to be updated.
string$foreign_tableThe foreign table.
string$foreign_columnThe foreign column.

References FieldStorageDefinitionInterface\getName(), and FieldStorageDefinitionInterface\getTargetEntityTypeId().

Referenced by ItemStorageSchema\getSharedTableFieldSchema(), NodeStorageSchema\getSharedTableFieldSchema(), and CommentStorageSchema\getSharedTableFieldSchema().

Here is the call graph for this function:

Here is the caller graph for this function:

addSharedTableFieldIndex ( FieldStorageDefinitionInterface  $storage_definition,
$schema,
  $not_null = FALSE,
  $size = NULL 
)
protected

Adds an index for the specified field to the given schema definition.

Parameters
\Drupal\Core\Field\FieldStorageDefinitionInterface$storage_definitionThe storage definition of the field for which an index should be added.
array$schemaA reference to the schema array to be updated.
bool$not_null(optional) Whether to also add a 'not null' constraint to the column being indexed. Doing so improves index performance. Defaults to FALSE, in case the field needs to support NULL values.
int$size(optional) The index size. Defaults to no limit.

References FieldStorageDefinitionInterface\getName(), and FieldStorageDefinitionInterface\getTargetEntityTypeId().

Referenced by FeedStorageSchema\getSharedTableFieldSchema(), ItemStorageSchema\getSharedTableFieldSchema(), FileStorageSchema\getSharedTableFieldSchema(), MenuLinkContentStorageSchema\getSharedTableFieldSchema(), EntityTestStorageSchema\getSharedTableFieldSchema(), NodeStorageSchema\getSharedTableFieldSchema(), UserStorageSchema\getSharedTableFieldSchema(), CommentStorageSchema\getSharedTableFieldSchema(), and TermStorageSchema\getSharedTableFieldSchema().

Here is the call graph for this function:

Here is the caller graph for this function:

addSharedTableFieldUniqueKey ( FieldStorageDefinitionInterface  $storage_definition,
$schema 
)
protected

Adds a unique key for the specified field to the given schema definition.

Also adds a 'not null' constraint, because many databases do not reliably support unique keys on null columns.

Parameters
\Drupal\Core\Field\FieldStorageDefinitionInterface$storage_definitionThe storage definition of the field to which to add a unique key.
array$schemaA reference to the schema array to be updated.

References FieldStorageDefinitionInterface\getName(), and FieldStorageDefinitionInterface\getTargetEntityTypeId().

Here is the call graph for this function:

addTableDefaults ( $schema)
protected

Adds defaults to a table schema definition.

Parameters
$schemaThe schema definition array for a single table, passed by reference.

Referenced by SqlContentEntityStorageSchema\initializeBaseTable(), SqlContentEntityStorageSchema\initializeDataTable(), SqlContentEntityStorageSchema\initializeRevisionDataTable(), and SqlContentEntityStorageSchema\initializeRevisionTable().

Here is the caller graph for this function:

addUniqueKey (   $table,
  $name,
array  $specifier 
)
protected

Creates a unique key, dropping it if already existing.

Parameters
string$tableThe table name.
string$nameThe index name.
array$specifierThe unique fields.
See Also
::addUniqueKey()

References Drupal\database().

Here is the call graph for this function:

checkEntityType ( EntityTypeInterface  $entity_type)
protected

Checks that we are dealing with the correct entity type.

Parameters
\Drupal\Core\Entity\EntityTypeInterface$entity_typeThe entity type to be checked.
Returns
bool TRUE if the entity type matches the current one.
Exceptions
\Drupal\Core\Entity\EntityStorageException

References EntityTypeInterface\id().

Referenced by SqlContentEntityStorageSchema\getEntitySchema(), SqlContentEntityStorageSchema\onEntityTypeCreate(), SqlContentEntityStorageSchema\onEntityTypeDelete(), and SqlContentEntityStorageSchema\onEntityTypeUpdate().

Here is the call graph for this function:

Here is the caller graph for this function:

createDedicatedTableSchema ( FieldStorageDefinitionInterface  $storage_definition)
protected

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

Parameters
\Drupal\Core\Field\FieldStorageDefinitionInterface$storage_definitionThe storage definition of the field being created.

References Drupal\database(), SqlContentEntityStorageSchema\getDedicatedTableSchema(), and SqlContentEntityStorageSchema\saveFieldSchemaData().

Referenced by SqlContentEntityStorageSchema\onEntityTypeCreate().

Here is the call graph for this function:

Here is the caller graph for this function:

createEntitySchemaIndexes ( array  $entity_schema,
FieldStorageDefinitionInterface  $storage_definition = NULL 
)
protected

Creates the specified entity schema indexes and keys.

Parameters
array$entity_schemaThe entity schema definition.
\Drupal\Core\Field\FieldStorageDefinitionInterface | NULL$storage_definition(optional) If a field storage definition is specified, only indexes and keys involving its columns will be processed. Otherwise all defined entity indexes and keys will be processed.

References Drupal\database(), and SqlContentEntityStorageSchema\getEntitySchemaData().

Referenced by SqlContentEntityStorageSchema\createSharedTableSchema(), and SqlContentEntityStorageSchema\onEntityTypeUpdate().

Here is the call graph for this function:

Here is the caller graph for this function:

createSharedTableSchema ( FieldStorageDefinitionInterface  $storage_definition,
  $only_save = FALSE 
)
protected

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

Parameters
\Drupal\Core\Field\FieldStorageDefinitionInterface$storage_definitionThe storage definition of the field being created.
bool$only_save(optional) Whether to skip modification of database tables and only save the schema data for future comparison. For internal use only. This is used by onEntityTypeCreate() after it has already fully created the shared tables.

References SqlContentEntityStorageSchema\addIndex(), SqlContentEntityStorageSchema\createEntitySchemaIndexes(), Drupal\database(), SqlContentEntityStorageSchema\getEntitySchema(), FieldStorageDefinitionInterface\getName(), SqlContentEntityStorageSchema\getSharedTableFieldSchema(), and SqlContentEntityStorageSchema\saveFieldSchemaData().

Referenced by SqlContentEntityStorageSchema\onEntityTypeCreate(), and SqlContentEntityStorageSchema\updateSharedTableSchema().

Here is the call graph for this function:

Here is the caller graph for this function:

deleteDedicatedTableSchema ( FieldStorageDefinitionInterface  $storage_definition)
protected

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

Parameters
\Drupal\Core\Field\FieldStorageDefinitionInterface$storage_definitionThe storage definition of the field being deleted.

References Drupal\database(), and SqlContentEntityStorageSchema\deleteFieldSchemaData().

Referenced by SqlContentEntityStorageSchema\onEntityTypeDelete().

Here is the call graph for this function:

Here is the caller graph for this function:

deleteEntitySchemaData ( EntityTypeInterface  $entity_type)
protected

Deletes schema data for the given entity type definition.

Parameters
\Drupal\Core\Entity\EntityTypeInterface$entity_typeThe entity type definition.

References EntityTypeInterface\id(), and SqlContentEntityStorageSchema\installedStorageSchema().

Referenced by SqlContentEntityStorageSchema\onEntityTypeDelete().

Here is the call graph for this function:

Here is the caller graph for this function:

deleteEntitySchemaIndexes ( array  $entity_schema_data,
FieldStorageDefinitionInterface  $storage_definition = NULL 
)
protected

Deletes the specified entity schema indexes and keys.

Parameters
array$entity_schema_dataThe entity schema data definition.
\Drupal\Core\Field\FieldStorageDefinitionInterface | NULL$storage_definition(optional) If a field storage definition is specified, only indexes and keys involving its columns will be processed. Otherwise all defined entity indexes and keys will be processed.

References Drupal\database().

Referenced by SqlContentEntityStorageSchema\deleteSharedTableSchema(), and SqlContentEntityStorageSchema\onEntityTypeUpdate().

Here is the call graph for this function:

Here is the caller graph for this function:

deleteFieldSchemaData ( FieldStorageDefinitionInterface  $storage_definition)
protected

Deletes schema data for the given field storage definition.

Parameters
\Drupal\Core\Field\FieldStorageDefinitionInterface$storage_definitionThe field storage definition.

References FieldStorageDefinitionInterface\getName(), FieldStorageDefinitionInterface\getTargetEntityTypeId(), and SqlContentEntityStorageSchema\installedStorageSchema().

Referenced by SqlContentEntityStorageSchema\deleteDedicatedTableSchema(), SqlContentEntityStorageSchema\deleteSharedTableSchema(), and SqlContentEntityStorageSchema\onEntityTypeDelete().

Here is the call graph for this function:

Here is the caller graph for this function:

deleteSharedTableSchema ( FieldStorageDefinitionInterface  $storage_definition)
protected

Deletes the schema for a field stored in a shared table.

Parameters
\Drupal\Core\Field\FieldStorageDefinitionInterface$storage_definitionThe storage definition of the field being deleted.

References Drupal\database(), SqlContentEntityStorageSchema\deleteEntitySchemaIndexes(), SqlContentEntityStorageSchema\deleteFieldSchemaData(), Drupal\entityManager(), FieldStorageDefinitionInterface\getName(), SqlContentEntityStorageSchema\getSharedTableFieldSchema(), and SqlContentEntityStorageSchema\loadEntitySchemaData().

Here is the call graph for this function:

finalizePurge ( FieldStorageDefinitionInterface  $storage_definition)

{Performs final cleanup after all data of a field has been purged.

Parameters
\Drupal\Core\Field\FieldStorageDefinitionInterface$storage_definitionThe field being purged.
}

Implements DynamicallyFieldableEntityStorageSchemaInterface.

References SqlContentEntityStorageSchema\performFieldSchemaOperation().

Here is the call graph for this function:

getColumnSchemaRelevantKeys ( )
protected

Returns a list of column schema keys affecting data storage.

When comparing schema definitions, only changes in certain properties actually affect how data is stored and thus, if applied, may imply data manipulation.

Returns
string[] An array of key names.
getDedicatedTableSchema ( FieldStorageDefinitionInterface  $storage_definition,
ContentEntityTypeInterface  $entity_type = NULL 
)
protected

Gets the SQL schema for a dedicated table.

Parameters
\Drupal\Core\Field\FieldStorageDefinitionInterface$storage_definitionThe field storage definition.
\Drupal\Core\Entity\ContentEntityTypeInterface$entity_type(optional) The entity type definition. Defaults to the one returned by the entity manager.
Returns
array The schema definition for the table with the following keys:
  • fields: The schema definition for the each field columns.
  • indexes: The schema definition for the indexes.
  • unique keys: The schema definition for the unique keys.
  • foreign keys: The schema definition for the foreign keys.
Exceptions
\Drupal\Core\Field\FieldExceptionException thrown if the schema contains reserved column names.
See Also
hook_schema()

References FieldStorageDefinitionInterface\getPropertyDefinitions(), and FieldStorageDefinitionInterface\getSchema().

Referenced by SqlContentEntityStorageSchema\createDedicatedTableSchema(), SqlContentEntityStorageSchema\getSchemaFromStorageDefinition(), and SqlContentEntityStorageSchema\updateDedicatedTableSchema().

Here is the call graph for this function:

Here is the caller graph for this function:

getEntityIndexName ( ContentEntityTypeInterface  $entity_type,
  $index 
)
protected

Gets the name to be used for the given entity index.

Parameters
\Drupal\Core\Entity\ContentEntityTypeInterface$entity_typeThe entity type.
string$indexThe index column name.
Returns
string The index name.

References EntityTypeInterface\id().

Referenced by SqlContentEntityStorageSchema\initializeBaseTable(), SqlContentEntityStorageSchema\initializeDataTable(), and SqlContentEntityStorageSchema\initializeRevisionTable().

Here is the call graph for this function:

Here is the caller graph for this function:

getEntitySchema ( ContentEntityTypeInterface  $entity_type,
  $reset = FALSE 
)
protected

Gets the entity schema for the specified entity type.

Entity types may override this method in order to optimize the generated schema of the entity tables. However, only cross-field optimizations should be added here; e.g., an index spanning multiple fields. Optimizations that apply to a single field have to be added via SqlContentEntityStorageSchema::getSharedTableFieldSchema() instead.

Parameters
\Drupal\Core\Entity\ContentEntityTypeInterface$entity_typeThe entity type definition.
bool$reset(optional) If set to TRUE static cache will be ignored and a new schema array generation will be performed. Defaults to FALSE.
Returns
array A Schema API array describing the entity schema, excluding dedicated field tables.
Exceptions
\Drupal\Core\Field\FieldException

References SqlContentEntityStorageSchema\checkEntityType(), Drupal\entityManager(), SqlContentEntityStorageSchema\getEntitySchemaTables(), SqlContentEntityStorageSchema\getSharedTableFieldSchema(), EntityTypeInterface\id(), SqlContentEntityStorageSchema\initializeBaseTable(), SqlContentEntityStorageSchema\initializeDataTable(), SqlContentEntityStorageSchema\initializeRevisionDataTable(), SqlContentEntityStorageSchema\initializeRevisionTable(), SqlContentEntityStorageSchema\processBaseTable(), SqlContentEntityStorageSchema\processDataTable(), SqlContentEntityStorageSchema\processRevisionDataTable(), and SqlContentEntityStorageSchema\processRevisionTable().

Referenced by SqlContentEntityStorageSchema\createSharedTableSchema(), SqlContentEntityStorageSchema\onEntityTypeCreate(), SqlContentEntityStorageSchema\onEntityTypeUpdate(), and SqlContentEntityStorageSchema\requiresEntityStorageSchemaChanges().

Here is the call graph for this function:

Here is the caller graph for this function:

getEntitySchemaData ( ContentEntityTypeInterface  $entity_type,
array  $schema 
)
protected

Gets entity schema definitions for index and key definitions.

Parameters
\Drupal\Core\Entity\ContentEntityTypeInterface$entity_typeThe entity type definition.
array$schemaThe entity schema array.
Returns
array A stripped down version of the $schema Schema API array containing, for each table, only the key and index definitions not derived from field storage definitions.

References Drupal\entityManager(), SqlContentEntityStorageSchema\getFieldSchemaIdentifierName(), and EntityTypeInterface\id().

Referenced by SqlContentEntityStorageSchema\createEntitySchemaIndexes(), SqlContentEntityStorageSchema\requiresEntityStorageSchemaChanges(), and SqlContentEntityStorageSchema\saveEntitySchemaData().

Here is the call graph for this function:

Here is the caller graph for this function:

getEntitySchemaTables ( )
protected

Gets a list of entity type tables.

Returns
array A list of entity type tables, keyed by table key.

Referenced by SqlContentEntityStorageSchema\getEntitySchema(), and SqlContentEntityStorageSchema\onEntityTypeDelete().

Here is the caller graph for this function:

getFieldForeignKeys (   $field_name,
array  $field_schema,
array  $column_mapping 
)
protected

Gets field foreign keys.

Parameters
string$field_nameThe name of the field.
array$field_schemaThe schema of the field.
string[]$column_mapping A mapping of field column names to database column names.
Returns
array The schema definition for the foreign keys.
getFieldIndexes (   $field_name,
array  $field_schema,
array  $column_mapping 
)
protected

Gets an index schema array for a given field.

Parameters
string$field_nameThe name of the field.
array$field_schemaThe schema of the field.
string[]$column_mapping A mapping of field column names to database column names.
Returns
array The schema definition for the indexes.

References SqlContentEntityStorageSchema\getFieldSchemaData().

Here is the call graph for this function:

getFieldIndexName ( FieldStorageDefinitionInterface  $storage_definition,
  $index 
)
protected

Generates an index name for a field data table.

Parameters
\Drupal\Core\Field\FieldStorageDefinitionInterface$storage_definitionThe field storage definition.
string$indexThe name of the index.
Returns
string A string containing a generated index name for a field data table that is unique among all other fields.

References FieldStorageDefinitionInterface\getName().

Referenced by SqlContentEntityStorageSchema\updateDedicatedTableSchema().

Here is the call graph for this function:

Here is the caller graph for this function:

getFieldSchemaData (   $field_name,
array  $field_schema,
array  $column_mapping,
  $schema_key 
)
protected

Gets field schema data for the given key.

Parameters
string$field_nameThe name of the field.
array$field_schemaThe schema of the field.
string[]$column_mapping A mapping of field column names to database column names.
string$schema_keyThe type of schema data. Either 'indexes' or 'unique keys'.
Returns
array The schema definition for the specified key.

References SqlContentEntityStorageSchema\getFieldSchemaIdentifierName().

Referenced by SqlContentEntityStorageSchema\getFieldIndexes(), and SqlContentEntityStorageSchema\getFieldUniqueKeys().

Here is the call graph for this function:

Here is the caller graph for this function:

getFieldSchemaIdentifierName (   $entity_type_id,
  $field_name,
  $key = NULL 
)
protected

Generates a safe schema identifier (name of an index, column name etc.).

Parameters
string$entity_type_idThe ID of the entity type.
string$field_nameThe name of the field.
string | null$key(optional) A further key to append to the name.
Returns
string The field identifier name.

Referenced by SqlContentEntityStorageSchema\getEntitySchemaData(), and SqlContentEntityStorageSchema\getFieldSchemaData().

Here is the caller graph for this function:

getFieldUniqueKeys (   $field_name,
array  $field_schema,
array  $column_mapping 
)
protected

Gets a unique key schema array for a given field.

Parameters
string$field_nameThe name of the field.
array$field_schemaThe schema of the field.
string[]$column_mapping A mapping of field column names to database column names.
Returns
array The schema definition for the unique keys.

References SqlContentEntityStorageSchema\getFieldSchemaData().

Here is the call graph for this function:

getSchemaFromStorageDefinition ( FieldStorageDefinitionInterface  $storage_definition)
protected

Gets the schema data for the given field storage definition.

Parameters
\Drupal\Core\Field\FieldStorageDefinitionInterface$storage_definitionThe field storage definition. The field that must not have custom storage, i.e. the storage must take care of storing the field.
Returns
array The schema data.

References SqlContentEntityStorageSchema\getDedicatedTableSchema(), FieldStorageDefinitionInterface\getName(), and SqlContentEntityStorageSchema\getSharedTableFieldSchema().

Referenced by SqlContentEntityStorageSchema\requiresFieldStorageSchemaChanges().

Here is the call graph for this function:

Here is the caller graph for this function:

getSharedTableFieldSchema ( FieldStorageDefinitionInterface  $storage_definition,
  $table_name,
array  $column_mapping 
)
protected

Gets the schema for a single field definition.

Entity types may override this method in order to optimize the generated schema for given field. While all optimizations that apply to a single field have to be added here, all cross-field optimizations should be via SqlContentEntityStorageSchema::getEntitySchema() instead; e.g., an index spanning multiple fields.

Parameters
\Drupal\Core\Field\FieldStorageDefinitionInterface$storage_definitionThe storage definition of the field whose schema has to be returned.
string$table_nameThe name of the table columns will be added to.
string[]$column_mapping A mapping of field column names to database column names.
Returns
array The schema definition for the table with the following keys:
  • fields: The schema definition for the each field columns.
  • indexes: The schema definition for the indexes.
  • unique keys: The schema definition for the unique keys.
  • foreign keys: The schema definition for the foreign keys.
Exceptions
\Drupal\Core\Field\FieldExceptionException thrown if the schema contains reserved column names.

References FieldStorageDefinitionInterface\getName(), and FieldStorageDefinitionInterface\getSchema().

Referenced by SqlContentEntityStorageSchema\createSharedTableSchema(), SqlContentEntityStorageSchema\deleteSharedTableSchema(), SqlContentEntityStorageSchema\getEntitySchema(), SqlContentEntityStorageSchema\getSchemaFromStorageDefinition(), and SqlContentEntityStorageSchema\updateSharedTableSchema().

Here is the call graph for this function:

Here is the caller graph for this function:

hasColumnChanges ( FieldStorageDefinitionInterface  $storage_definition,
FieldStorageDefinitionInterface  $original 
)
protected

Compares schemas to check for changes in the column definitions.

Parameters
\Drupal\Core\Field\FieldStorageDefinitionInterface$storage_definitionCurrent field storage definition.
\Drupal\Core\Field\FieldStorageDefinitionInterface$originalThe original field storage definition.
Returns
bool Returns TRUE if there are schema changes in the column definitions.

References FieldStorageDefinitionInterface\getColumns(), and FieldStorageDefinitionInterface\hasCustomStorage().

Referenced by SqlContentEntityStorageSchema\updateDedicatedTableSchema(), and SqlContentEntityStorageSchema\updateSharedTableSchema().

Here is the call graph for this function:

Here is the caller graph for this function:

hasNullFieldPropertyData (   $table_name,
  $column_name 
)
protected

Checks whether a field property has NULL values.

Parameters
string$table_nameThe name of the table to inspect.
string$column_nameThe name of the column holding the field property data.
Returns
bool TRUE if NULL data is found, FALSE otherwise.

References Drupal\database().

Referenced by SqlContentEntityStorageSchema\updateSharedTableSchema().

Here is the call graph for this function:

Here is the caller graph for this function:

hasSharedTableNameChanges ( EntityTypeInterface  $entity_type,
EntityTypeInterface  $original 
)
protected

Detects whether any table name got renamed in an entity type update.

Parameters
\Drupal\Core\Entity\EntityTypeInterface$entity_typeThe new entity type.
\Drupal\Core\Entity\EntityTypeInterface$originalThe origin entity type.
Returns
bool Returns TRUE if there have been changes.

References EntityTypeInterface\getBaseTable(), EntityTypeInterface\getDataTable(), EntityTypeInterface\getRevisionDataTable(), and EntityTypeInterface\getRevisionTable().

Referenced by SqlContentEntityStorageSchema\hasSharedTableStructureChange().

Here is the call graph for this function:

Here is the caller graph for this function:

hasSharedTableStructureChange ( EntityTypeInterface  $entity_type,
EntityTypeInterface  $original 
)
protected

Detects whether there is a change in the shared table structure.

Parameters
\Drupal\Core\Entity\EntityTypeInterface$entity_typeThe new entity type.
\Drupal\Core\Entity\EntityTypeInterface$originalThe origin entity type.
Returns
bool Returns TRUE if either the revisionable or translatable flag changes or a table has been renamed.

References SqlContentEntityStorageSchema\hasSharedTableNameChanges(), EntityTypeInterface\isRevisionable(), and EntityTypeInterface\isTranslatable().

Referenced by SqlContentEntityStorageSchema\requiresEntityDataMigration(), and SqlContentEntityStorageSchema\requiresEntityStorageSchemaChanges().

Here is the call graph for this function:

Here is the caller graph for this function:

initializeBaseTable ( ContentEntityTypeInterface  $entity_type)
protected

Initializes common information for a base table.

Parameters
\Drupal\Core\Entity\ContentEntityTypeInterface$entity_typeThe entity type.
Returns
array A partial schema array for the base table.

References SqlContentEntityStorageSchema\addTableDefaults(), SqlContentEntityStorageSchema\getEntityIndexName(), EntityTypeInterface\getKey(), EntityTypeInterface\hasKey(), and EntityTypeInterface\id().

Referenced by SqlContentEntityStorageSchema\getEntitySchema().

Here is the call graph for this function:

Here is the caller graph for this function:

initializeDataTable ( ContentEntityTypeInterface  $entity_type)
protected

Initializes common information for a data table.

Parameters
\Drupal\Core\Entity\ContentEntityTypeInterface$entity_typeThe entity type.
Returns
array A partial schema array for the data table.

References SqlContentEntityStorageSchema\addTableDefaults(), SqlContentEntityStorageSchema\getEntityIndexName(), EntityTypeInterface\getKey(), EntityTypeInterface\hasKey(), and EntityTypeInterface\id().

Referenced by SqlContentEntityStorageSchema\getEntitySchema().

Here is the call graph for this function:

Here is the caller graph for this function:

initializeRevisionDataTable ( ContentEntityTypeInterface  $entity_type)
protected

Initializes common information for a revision data table.

Parameters
\Drupal\Core\Entity\ContentEntityTypeInterface$entity_typeThe entity type.
Returns
array A partial schema array for the revision data table.

References SqlContentEntityStorageSchema\addTableDefaults(), EntityTypeInterface\getKey(), and EntityTypeInterface\id().

Referenced by SqlContentEntityStorageSchema\getEntitySchema().

Here is the call graph for this function:

Here is the caller graph for this function:

initializeRevisionTable ( ContentEntityTypeInterface  $entity_type)
protected

Initializes common information for a revision table.

Parameters
\Drupal\Core\Entity\ContentEntityTypeInterface$entity_typeThe entity type.
Returns
array A partial schema array for the revision table.

References SqlContentEntityStorageSchema\addTableDefaults(), SqlContentEntityStorageSchema\getEntityIndexName(), EntityTypeInterface\getKey(), and EntityTypeInterface\id().

Referenced by SqlContentEntityStorageSchema\getEntitySchema().

Here is the call graph for this function:

Here is the caller graph for this function:

installedStorageSchema ( )
protected

Gets the keyvalue collection for tracking the installed schema.

Returns
Todo:
Inject this dependency in the constructor once this class can be instantiated as a regular entity handler: https://www.drupal.org/node/2332857.

References Drupal\keyValue().

Referenced by SqlContentEntityStorageSchema\deleteEntitySchemaData(), SqlContentEntityStorageSchema\deleteFieldSchemaData(), SqlContentEntityStorageSchema\loadEntitySchemaData(), SqlContentEntityStorageSchema\loadFieldSchemaData(), SqlContentEntityStorageSchema\saveEntitySchemaData(), and SqlContentEntityStorageSchema\saveFieldSchemaData().

Here is the call graph for this function:

Here is the caller graph for this function:

isTableEmpty (   $table_name)
protected

Checks whether a database table is non-existent or empty.

Empty tables can be dropped and recreated without data loss.

Parameters
string$table_nameThe database table to check.
Returns
bool TRUE if the table is empty, FALSE otherwise.

References Drupal\database().

Referenced by SqlContentEntityStorageSchema\onEntityTypeUpdate().

Here is the call graph for this function:

Here is the caller graph for this function:

loadEntitySchemaData ( EntityTypeInterface  $entity_type)
protected

Loads stored schema data for the given entity type definition.

Parameters
\Drupal\Core\Entity\EntityTypeInterface$entity_typeThe entity type definition.
Returns
array The entity schema data array.

References EntityTypeInterface\id(), and SqlContentEntityStorageSchema\installedStorageSchema().

Referenced by SqlContentEntityStorageSchema\deleteSharedTableSchema(), SqlContentEntityStorageSchema\onEntityTypeUpdate(), and SqlContentEntityStorageSchema\requiresEntityStorageSchemaChanges().

Here is the call graph for this function:

Here is the caller graph for this function:

loadFieldSchemaData ( FieldStorageDefinitionInterface  $storage_definition)
protected

Loads stored schema data for the given field storage definition.

Parameters
\Drupal\Core\Field\FieldStorageDefinitionInterface$storage_definitionThe field storage definition.
Returns
array The field schema data array.

References FieldStorageDefinitionInterface\getName(), FieldStorageDefinitionInterface\getTargetEntityTypeId(), and SqlContentEntityStorageSchema\installedStorageSchema().

Referenced by SqlContentEntityStorageSchema\requiresFieldStorageSchemaChanges(), and SqlContentEntityStorageSchema\updateSharedTableSchema().

Here is the call graph for this function:

Here is the caller graph for this function:

onEntityTypeCreate ( EntityTypeInterface  $entity_type)

{Reacts to the creation of the entity type.

Parameters
\Drupal\Core\Entity\EntityTypeInterface$entity_typeThe entity type being created.
}

Implements EntityTypeListenerInterface.

References SqlContentEntityStorageSchema\checkEntityType(), SqlContentEntityStorageSchema\createDedicatedTableSchema(), SqlContentEntityStorageSchema\createSharedTableSchema(), Drupal\database(), Drupal\entityManager(), SqlContentEntityStorageSchema\getEntitySchema(), EntityTypeInterface\id(), and SqlContentEntityStorageSchema\saveEntitySchemaData().

Referenced by SqlContentEntityStorageSchema\onEntityTypeUpdate().

Here is the call graph for this function:

Here is the caller graph for this function:

onEntityTypeDelete ( EntityTypeInterface  $entity_type)

{Reacts to the deletion of the entity type.

Parameters
\Drupal\Core\Entity\EntityTypeInterface$entity_typeThe entity type being deleted.
}

Implements EntityTypeListenerInterface.

References SqlContentEntityStorageSchema\checkEntityType(), Drupal\database(), SqlContentEntityStorageSchema\deleteDedicatedTableSchema(), SqlContentEntityStorageSchema\deleteEntitySchemaData(), SqlContentEntityStorageSchema\deleteFieldSchemaData(), Drupal\entityManager(), SqlContentEntityStorageSchema\getEntitySchemaTables(), and EntityTypeInterface\id().

Referenced by SqlContentEntityStorageSchema\onEntityTypeUpdate().

Here is the call graph for this function:

Here is the caller graph for this function:

onEntityTypeUpdate ( EntityTypeInterface  $entity_type,
EntityTypeInterface  $original 
)
onFieldStorageDefinitionCreate ( FieldStorageDefinitionInterface  $storage_definition)

{Reacts to the creation of a field storage definition.

Parameters
\Drupal\Core\Field\FieldStorageDefinitionInterface$storage_definitionThe definition being created.
}

Implements FieldStorageDefinitionListenerInterface.

References SqlContentEntityStorageSchema\performFieldSchemaOperation().

Here is the call graph for this function:

onFieldStorageDefinitionDelete ( FieldStorageDefinitionInterface  $storage_definition)

{Reacts to the deletion of a field storage definition.

Parameters
\Drupal\Core\Field\FieldStorageDefinitionInterface$storage_definitionThe field being deleted.
}

Implements FieldStorageDefinitionListenerInterface.

References Drupal\database(), Drupal\entityManager(), FieldStorageDefinitionInterface\getName(), FieldStorageDefinitionInterface\getTargetEntityTypeId(), and SqlContentEntityStorageSchema\performFieldSchemaOperation().

Here is the call graph for this function:

onFieldStorageDefinitionUpdate ( FieldStorageDefinitionInterface  $storage_definition,
FieldStorageDefinitionInterface  $original 
)

{Reacts to the update of a field storage definition.

Parameters
\Drupal\Core\Field\FieldStorageDefinitionInterface$storage_definitionThe field being updated.
\Drupal\Core\Field\FieldStorageDefinitionInterface$originalThe original storage definition; i.e., the definition before the update.
Exceptions
\Drupal\Core\Entity\Exception\FieldStorageDefinitionUpdateForbiddenExceptionThrown when the update to the field is forbidden.
}

Implements FieldStorageDefinitionListenerInterface.

References FieldStorageDefinitionInterface\getName(), and SqlContentEntityStorageSchema\performFieldSchemaOperation().

Here is the call graph for this function:

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

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$operationThe name of the operation to be performed.
\Drupal\Core\Field\FieldStorageDefinitionInterface$storage_definitionThe 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.

Referenced by SqlContentEntityStorageSchema\finalizePurge(), SqlContentEntityStorageSchema\onFieldStorageDefinitionCreate(), SqlContentEntityStorageSchema\onFieldStorageDefinitionDelete(), SqlContentEntityStorageSchema\onFieldStorageDefinitionUpdate(), SqlContentEntityStorageSchema\updateDedicatedTableSchema(), and SqlContentEntityStorageSchema\updateSharedTableSchema().

Here is the caller graph for this function:

processBaseTable ( ContentEntityTypeInterface  $entity_type,
array &  $schema 
)
protected

Processes the gathered schema for a base table.

Parameters
\Drupal\Core\Entity\ContentEntityTypeInterface$entity_typeThe entity type.
array$schemaThe table schema, passed by reference.
Returns
array A partial schema array for the base table.

References EntityTypeInterface\getKey(), and SqlContentEntityStorageSchema\processIdentifierSchema().

Referenced by SqlContentEntityStorageSchema\getEntitySchema().

Here is the call graph for this function:

Here is the caller graph for this function:

processDataTable ( ContentEntityTypeInterface  $entity_type,
array &  $schema 
)
protected

Processes the gathered schema for a base table.

Parameters
\Drupal\Core\Entity\ContentEntityTypeInterface$entity_typeThe entity type.
array$schemaThe table schema, passed by reference.
Returns
array A partial schema array for the base table.

References EntityTypeInterface\getKey().

Referenced by SqlContentEntityStorageSchema\getEntitySchema().

Here is the call graph for this function:

Here is the caller graph for this function:

processIdentifierSchema ( $schema,
  $key 
)
protected

Processes the specified entity key.

Parameters
array$schemaThe table schema, passed by reference.
string$keyThe entity key name.

Referenced by SqlContentEntityStorageSchema\processBaseTable(), and SqlContentEntityStorageSchema\processRevisionTable().

Here is the caller graph for this function:

processRevisionDataTable ( ContentEntityTypeInterface  $entity_type,
array &  $schema 
)
protected

Processes the gathered schema for a base table.

Parameters
\Drupal\Core\Entity\ContentEntityTypeInterface$entity_typeThe entity type.
array$schemaThe table schema, passed by reference.
Returns
array A partial schema array for the base table.

References EntityTypeInterface\getKey().

Referenced by SqlContentEntityStorageSchema\getEntitySchema().

Here is the call graph for this function:

Here is the caller graph for this function:

processRevisionTable ( ContentEntityTypeInterface  $entity_type,
array &  $schema 
)
protected

Processes the gathered schema for a base table.

Parameters
\Drupal\Core\Entity\ContentEntityTypeInterface$entity_typeThe entity type.
array$schemaThe table schema, passed by reference.
Returns
array A partial schema array for the base table.

References EntityTypeInterface\getKey(), and SqlContentEntityStorageSchema\processIdentifierSchema().

Referenced by SqlContentEntityStorageSchema\getEntitySchema().

Here is the call graph for this function:

Here is the caller graph for this function:

requiresEntityDataMigration ( EntityTypeInterface  $entity_type,
EntityTypeInterface  $original 
)

{Checks if existing data would be lost if the schema changes were applied.If there are no schema changes needed, then no data needs to be migrated, but it is not the responsibility of this function to recheck what requiresEntityStorageSchemaChanges() checks. Rather, the meaning of what this function returns when requiresEntityStorageSchemaChanges() returns FALSE is undefined. Callers are expected to only call this function when requiresEntityStorageSchemaChanges() is TRUE.This function can return FALSE if any of these conditions apply:

  • There are no existing entities for the entity type.
  • There are existing entities, but the schema changes can be applied without losing their data (e.g., if the schema changes can be performed by altering tables rather than dropping and recreating them).
  • The only entity data that would be lost are ones that are not valid for the new definition (e.g., if changing an entity type from revisionable to non-revisionable, then it's okay to drop data for the non-default revision).
When this function returns FALSE, site administrators will be unable to perform an automated update, and will instead need to perform a site migration or invoke some custom update process.
Parameters
\Drupal\Core\Entity\EntityTypeInterface$entity_typeThe updated entity type definition.
\Drupal\Core\Entity\EntityTypeInterface$originalThe original entity type definition.
Returns
bool TRUE if data migration is required, FALSE otherwise.
See Also
self::requiresEntityStorageSchemaChanges()
}

Implements EntityStorageSchemaInterface.

References Drupal\entityManager(), EntityTypeInterface\getStorageClass(), and SqlContentEntityStorageSchema\hasSharedTableStructureChange().

Referenced by SqlContentEntityStorageSchema\onEntityTypeUpdate().

Here is the call graph for this function:

Here is the caller graph for this function:

requiresEntityStorageSchemaChanges ( EntityTypeInterface  $entity_type,
EntityTypeInterface  $original 
)

{Checks if the changes to the entity type requires storage schema changes.

Parameters
\Drupal\Core\Entity\EntityTypeInterface$entity_typeThe updated entity type definition.
\Drupal\Core\Entity\EntityTypeInterface$originalThe original entity type definition.
Returns
bool TRUE if storage schema changes are required, FALSE otherwise.
}

Implements EntityStorageSchemaInterface.

References SqlContentEntityStorageSchema\getEntitySchema(), SqlContentEntityStorageSchema\getEntitySchemaData(), SqlContentEntityStorageSchema\hasSharedTableStructureChange(), and SqlContentEntityStorageSchema\loadEntitySchemaData().

Referenced by SqlContentEntityStorageSchema\onEntityTypeUpdate().

Here is the call graph for this function:

Here is the caller graph for this function:

requiresFieldDataMigration ( FieldStorageDefinitionInterface  $storage_definition,
FieldStorageDefinitionInterface  $original 
)

{Checks if existing data would be lost if the schema changes were applied.If there are no schema changes needed, then no data needs to be migrated, but it is not the responsibility of this function to recheck what requiresFieldStorageSchemaChanges() checks. Rather, the meaning of what this function returns when requiresFieldStorageSchemaChanges() returns FALSE is undefined. Callers are expected to only call this function when requiresFieldStorageSchemaChanges() is TRUE.This function can return FALSE if any of these conditions apply:

  • There are no existing entities for the entity type to which this field is attached.
  • There are existing entities, but none with existing values for this field.
  • There are existing field values, but the schema changes can be applied without losing them (e.g., if the schema changes can be performed by altering tables rather than dropping and recreating them).
  • The only field values that would be lost are ones that are not valid for the new definition (e.g., if changing a field from revisionable to non-revisionable, then it's okay to drop data for the non-default revision).
When this function returns FALSE, site administrators will be unable to perform an automated update, and will instead need to perform a site migration or invoke some custom update process.
Parameters
\Drupal\Core\Field\FieldStorageDefinitionInterface$storage_definitionThe updated field storage definition.
\Drupal\Core\Field\FieldStorageDefinitionInterface$originalThe original field storage definition.
Returns
bool TRUE if data migration is required, FALSE otherwise.
See Also
self::requiresFieldStorageSchemaChanges()
}

Implements DynamicallyFieldableEntityStorageSchemaInterface.

requiresFieldStorageSchemaChanges ( FieldStorageDefinitionInterface  $storage_definition,
FieldStorageDefinitionInterface  $original 
)

{Checks if the changes to the storage definition requires schema changes.

Parameters
\Drupal\Core\Field\FieldStorageDefinitionInterface$storage_definitionThe updated field storage definition.
\Drupal\Core\Field\FieldStorageDefinitionInterface$originalThe original field storage definition.
Returns
bool TRUE if storage schema changes are required, FALSE otherwise.
}

Implements DynamicallyFieldableEntityStorageSchemaInterface.

References FieldStorageDefinitionInterface\getSchema(), SqlContentEntityStorageSchema\getSchemaFromStorageDefinition(), FieldStorageDefinitionInterface\hasCustomStorage(), FieldStorageDefinitionInterface\isRevisionable(), and SqlContentEntityStorageSchema\loadFieldSchemaData().

Here is the call graph for this function:

saveEntitySchemaData ( EntityTypeInterface  $entity_type,
  $schema 
)
protected

Stores schema data for the given entity type definition.

Parameters
\Drupal\Core\Entity\EntityTypeInterface$entity_typeThe entity type definition.
array$schemaThe entity schema data array.

References SqlContentEntityStorageSchema\getEntitySchemaData(), EntityTypeInterface\id(), and SqlContentEntityStorageSchema\installedStorageSchema().

Referenced by SqlContentEntityStorageSchema\onEntityTypeCreate(), and SqlContentEntityStorageSchema\onEntityTypeUpdate().

Here is the call graph for this function:

Here is the caller graph for this function:

saveFieldSchemaData ( FieldStorageDefinitionInterface  $storage_definition,
  $schema 
)
protected

Stores schema data for the given field storage definition.

Parameters
\Drupal\Core\Field\FieldStorageDefinitionInterface$storage_definitionThe field storage definition.
array$schemaThe field schema data array.

References FieldStorageDefinitionInterface\getName(), FieldStorageDefinitionInterface\getTargetEntityTypeId(), and SqlContentEntityStorageSchema\installedStorageSchema().

Referenced by SqlContentEntityStorageSchema\createDedicatedTableSchema(), SqlContentEntityStorageSchema\createSharedTableSchema(), SqlContentEntityStorageSchema\updateDedicatedTableSchema(), and SqlContentEntityStorageSchema\updateSharedTableSchema().

Here is the call graph for this function:

Here is the caller graph for this function:

updateDedicatedTableSchema ( FieldStorageDefinitionInterface  $storage_definition,
FieldStorageDefinitionInterface  $original 
)
protected

Updates the schema for a field stored in a shared table.

Parameters
\Drupal\Core\Field\FieldStorageDefinitionInterface$storage_definitionThe storage definition of the field being updated.
\Drupal\Core\Field\FieldStorageDefinitionInterface$originalThe original storage definition; i.e., the definition before the update.
Exceptions
\Drupal\Core\Entity\Exception\FieldStorageDefinitionUpdateForbiddenExceptionThrown when the update to the field is forbidden.
\ExceptionRethrown exception if the table recreation fails.

References SqlContentEntityStorageSchema\addIndex(), Drupal\database(), SqlContentEntityStorageSchema\getDedicatedTableSchema(), SqlContentEntityStorageSchema\getFieldIndexName(), FieldStorageDefinitionInterface\getName(), FieldStorageDefinitionInterface\getSchema(), FieldStorageDefinitionInterface\getTargetEntityTypeId(), SqlContentEntityStorageSchema\hasColumnChanges(), SqlContentEntityStorageSchema\performFieldSchemaOperation(), and SqlContentEntityStorageSchema\saveFieldSchemaData().

Here is the call graph for this function:

updateSharedTableSchema ( FieldStorageDefinitionInterface  $storage_definition,
FieldStorageDefinitionInterface  $original 
)
protected

Updates the schema for a field stored in a shared table.

Parameters
\Drupal\Core\Field\FieldStorageDefinitionInterface$storage_definitionThe storage definition of the field being updated.
\Drupal\Core\Field\FieldStorageDefinitionInterface$originalThe original storage definition; i.e., the definition before the update.
Exceptions
\Drupal\Core\Entity\Exception\FieldStorageDefinitionUpdateForbiddenExceptionThrown when the update to the field is forbidden.
\ExceptionRethrown exception if the table recreation fails.

References SqlContentEntityStorageSchema\addIndex(), SqlContentEntityStorageSchema\createSharedTableSchema(), Drupal\database(), FieldStorageDefinitionInterface\getName(), SqlContentEntityStorageSchema\getSharedTableFieldSchema(), FieldStorageDefinitionInterface\getTargetEntityTypeId(), SqlContentEntityStorageSchema\hasColumnChanges(), SqlContentEntityStorageSchema\hasNullFieldPropertyData(), SqlContentEntityStorageSchema\loadFieldSchemaData(), SqlContentEntityStorageSchema\performFieldSchemaOperation(), and SqlContentEntityStorageSchema\saveFieldSchemaData().

Here is the call graph for this function:


The documentation for this class was generated from the following file: