Mercurial > hg > cmmr2012-drupal-site
view core/modules/content_moderation/src/ContentModerationStateStorageSchema.php @ 0:c75dbcec494b
Initial commit from drush-created site
author | Chris Cannam |
---|---|
date | Thu, 05 Jul 2018 14:24:15 +0000 |
parents | |
children | a9cd425dd02b |
line wrap: on
line source
<?php namespace Drupal\content_moderation; use Drupal\Core\Entity\ContentEntityTypeInterface; use Drupal\Core\Entity\Sql\SqlContentEntityStorageSchema; /** * Defines the content moderation state schema handler. */ class ContentModerationStateStorageSchema extends SqlContentEntityStorageSchema { /** * {@inheritdoc} */ protected function getEntitySchema(ContentEntityTypeInterface $entity_type, $reset = FALSE) { $schema = parent::getEntitySchema($entity_type, $reset); // Creates unique keys to guarantee the integrity of the entity and to make // the lookup in ModerationStateFieldItemList::getModerationState() fast. $unique_keys = [ 'content_entity_type_id', 'content_entity_id', 'content_entity_revision_id', 'workflow', 'langcode', ]; $schema['content_moderation_state_field_data']['unique keys'] += [ 'content_moderation_state__lookup' => $unique_keys, ]; $schema['content_moderation_state_field_revision']['unique keys'] += [ 'content_moderation_state__lookup' => $unique_keys, ]; return $schema; } }