You are here

public function BrightcoveVideo::getVideoFile in Brightcove Video Connect 8.2

Same name and namespace in other branches
  1. 8 src/Entity/BrightcoveVideo.php \Drupal\brightcove\Entity\BrightcoveVideo::getVideoFile()
  2. 3.x src/Entity/BrightcoveVideo.php \Drupal\brightcove\Entity\BrightcoveVideo::getVideoFile()

Returns the video file.

Return value

array The video file entity.

Overrides BrightcoveVideoInterface::getVideoFile

2 calls to BrightcoveVideo::getVideoFile()
BrightcoveVideo::save in src/Entity/BrightcoveVideo.php
BrightcoveVideo::setVideoFile in src/Entity/BrightcoveVideo.php
Sets the video file.

File

src/Entity/BrightcoveVideo.php, line 392

Class

BrightcoveVideo
Defines the Brightcove Video entity.

Namespace

Drupal\brightcove\Entity

Code

public function getVideoFile() {
  $value = $this
    ->get('video_file')
    ->getValue();
  if (empty($value[0]['target_id'])) {
    return [];
  }
  if (!isset($value[0]['upload'])) {
    $value[0]['upload'] = '';
  }
  return $value[0];
}