protected SqlContentEntityStorageSchema::initializeRevisionDataTable(ContentEntityTypeInterface $entity_type)
Initializes common information for a revision data table.
Parameters
\Drupal\Core\Entity\ContentEntityTypeInterface $entity_type: The entity type.
Return value
array A partial schema array for the revision data table.
File
- core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php, line 948
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 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | protected function initializeRevisionDataTable(ContentEntityTypeInterface $entity_type ) { $entity_type_id = $entity_type ->id(); $id_key = $entity_type ->getKey( 'id' ); $revision_key = $entity_type ->getKey( 'revision' ); $schema = array ( 'description' => "The revision data table for $entity_type_id entities." , 'primary key' => array ( $revision_key , $entity_type ->getKey( 'langcode' )), 'indexes' => array ( $entity_type_id . '__id__default_langcode__langcode' => array ( $id_key , $entity_type ->getKey( 'default_langcode' ), $entity_type ->getKey( 'langcode' )), ), 'foreign keys' => array ( $entity_type_id => array ( 'table' => $this ->storage->getBaseTable(), 'columns' => array ( $id_key => $id_key ), ), $entity_type_id . '__revision' => array ( 'table' => $this ->storage->getRevisionTable(), 'columns' => array ( $revision_key => $revision_key ), ) ), ); $this ->addTableDefaults( $schema ); return $schema ; } |
Please login to continue.