You are here

function paragraphs_update_8001 in Paragraphs 8

Add status field.

File

./paragraphs.install, line 24
Installation hooks for Paragraphs module.

Code

function paragraphs_update_8001() {
  $storage_definition = BaseFieldDefinition::create('boolean')
    ->setLabel(t('Published'))
    ->setRevisionable(TRUE)
    ->setTranslatable(TRUE);
  \Drupal::entityDefinitionUpdateManager()
    ->installFieldStorageDefinition('status', 'paragraph', 'paragraph', $storage_definition);
}