You are here

function brightcove_update_8104 in Brightcove Video Connect 8

Same name and namespace in other branches
  1. 8.2 brightcove.install \brightcove_update_8104()
  2. 3.x brightcove.install \brightcove_update_8104()

Updates the entity with the video_url base field.

File

./brightcove.install, line 185
Brightcove install file.

Code

function brightcove_update_8104() {
  $storage_definition = BaseFieldDefinition::create('uri')
    ->setLabel(t('Video source URL'))
    ->setDisplayOptions('form', [
    'type' => 'uri',
  ])
    ->setDisplayOptions('view', [
    'type' => 'uri_link',
    'label' => 'inline',
    'settings' => [
      'trim_length' => 150,
      'target' => '_blank',
    ],
  ])
    ->setDisplayConfigurable('form', TRUE)
    ->setDisplayConfigurable('view', TRUE);
  \Drupal::entityDefinitionUpdateManager()
    ->installFieldStorageDefinition('video_url', 'brightcove_video', 'brightcove_video', $storage_definition);
}