You are here

function scheduled_transitions_update_8003 in Scheduled Transitions 8

Same name and namespace in other branches
  1. 2.x scheduled_transitions.install \scheduled_transitions_update_8003()

Add the 'entity_revision_langcode' field to 'scheduled_transition' entities.

File

./scheduled_transitions.install, line 44

Code

function scheduled_transitions_update_8003() : void {
  $storageDefinition = BaseFieldDefinition::create('language')
    ->setLabel(\t('Content entity revision language'))
    ->setDescription(\t('The revision language of the entity this scheduled transition is for.'))
    ->setRequired(TRUE)
    ->setCardinality(1);
  \Drupal::entityDefinitionUpdateManager()
    ->installFieldStorageDefinition('entity_revision_langcode', 'scheduled_transition', 'scheduled_transition', $storageDefinition);
}