You are here

public function BrightcoveVideo::createSourceField in Brightcove Video Connect 8

Same name and namespace in other branches
  1. 8.2 modules/media_entity_brightcove/src/Plugin/MediaEntity/Type/BrightcoveVideo.php \Drupal\media_entity_brightcove\Plugin\MediaEntity\Type\BrightcoveVideo::createSourceField()
  2. 3.x modules/media_entity_brightcove/src/Plugin/MediaEntity/Type/BrightcoveVideo.php \Drupal\media_entity_brightcove\Plugin\MediaEntity\Type\BrightcoveVideo::createSourceField()

File

modules/media_entity_brightcove/src/Plugin/MediaEntity/Type/BrightcoveVideo.php, line 205

Class

BrightcoveVideo
Defines video field type for media.

Namespace

Drupal\media_entity_brightcove\Plugin\MediaEntity\Type

Code

public function createSourceField(MediaBundleInterface $bundle) {
  return $this->entityTypeManager
    ->getStorage('field_config')
    ->create([
    'field_storage' => $this
      ->getSourceFieldStorage(),
    'bundle' => $bundle
      ->id(),
    'required' => TRUE,
    'label' => 'Brightcove Video',
    'settings' => [
      'handler' => 'default:brightcove_video',
    ],
  ]);
}