You are here

public function BrightcoveVideoEntityController::save in Brightcove Video Connect 7.6

Same name and namespace in other branches
  1. 7.7 brightcove.video.inc \BrightcoveVideoEntityController::save()

Implements EntityAPIControllerInterface.

Parameters

$transaction: Optionally a DatabaseTransaction object to use. Allows overrides to pass in their transaction object.

Overrides EntityAPIController::save

File

./brightcove.video.inc, line 84
Brightcove video related functions.

Class

BrightcoveVideoEntityController
Entity controller class for Brightcove video.

Code

public function save($entity, DatabaseTransaction $transaction = NULL) {
  if (empty($entity->videoSaved)) {
    $entity->video = brightcove_save_video($entity->video, $entity->client);
  }
  $entity->account_id = $entity->client->account_id;
  if (empty($entity->video_id)) {
    $entity->video_id = $entity->video
      ->getId();
  }
  return parent::save($entity, $transaction);
}