You are here

function brightcove_update_8103 in Brightcove Video Connect 8

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

Sets a default callback for the reference_id.

File

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

Code

function brightcove_update_8103() {

  /** @var \Drupal\Core\Field\BaseFieldDefinition $installed_field_definition */
  $installed_field_definition = \Drupal::entityDefinitionUpdateManager()
    ->getFieldStorageDefinition('reference_id', 'brightcove_video');
  $installed_field_definition
    ->setDefaultValueCallback('\\Drupal\\brightcove\\Entity\\BrightcoveVideo::getDefaultReferenceId');
  \Drupal::entityDefinitionUpdateManager()
    ->updateFieldStorageDefinition($installed_field_definition);

  /** @var \Drupal\Core\Field\BaseFieldDefinition $installed_field_definition */
  $installed_field_definition = \Drupal::entityDefinitionUpdateManager()
    ->getFieldStorageDefinition('reference_id', 'brightcove_playlist');
  $installed_field_definition
    ->setDefaultValueCallback('\\Drupal\\brightcove\\Entity\\BrightcovePlaylist::getDefaultReferenceId');
  \Drupal::entityDefinitionUpdateManager()
    ->updateFieldStorageDefinition($installed_field_definition);
}