You are here

public function BrightcoveVideo::setVideoFile in Brightcove Video Connect 8

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

Sets the video file.

Parameters

array|null $video_file: The video file entity.

Return value

\Drupal\brightcove\BrightcoveVideoInterface The called Brightcove Video.

Overrides BrightcoveVideoInterface::setVideoFile

File

src/Entity/BrightcoveVideo.php, line 404

Class

BrightcoveVideo
Defines the Brightcove Video entity.

Namespace

Drupal\brightcove\Entity

Code

public function setVideoFile($video_file) {
  $video_to_delete = $this
    ->getVideoFile();
  if ($video_file == NULL && !empty($video_to_delete['target_id'])) {
    $this
      ->deleteFile($video_to_delete['target_id']);
  }
  $this
    ->set('video_file', $video_file);
  return $this;
}