/** * Allows you to add an cue point object associated with an entry * * @action add * @param KalturaCuePoint $cuePoint * @return KalturaCuePoint */ function addAction(KalturaCuePoint $cuePoint) { $dbCuePoint = $cuePoint->toInsertableObject(); if ($cuePoint->systemName) { $existingCuePoint = CuePointPeer::retrieveBySystemName($cuePoint->entryId, $cuePoint->systemName); if ($existingCuePoint) { throw new KalturaAPIException(KalturaCuePointErrors::CUE_POINT_SYSTEM_NAME_EXISTS, $cuePoint->systemName, $existingCuePoint->getId()); } } /* @var $dbCuePoint CuePoint */ $dbCuePoint->setPartnerId($this->getPartnerId()); $dbCuePoint->setPuserId(is_null($cuePoint->userId) ? $this->getKuser()->getPuserId() : $cuePoint->userId); $dbCuePoint->setStatus(CuePointStatus::READY); if ($this->getCuePointType()) { $dbCuePoint->setType($this->getCuePointType()); } $created = $dbCuePoint->save(); if (!$created) { KalturaLog::err("Cue point not created"); return null; } $cuePoint = KalturaCuePoint::getInstance($dbCuePoint, $this->getResponseProfile()); if (!$cuePoint) { KalturaLog::err("API Cue point not instantiated"); return null; } return $cuePoint; }
public function toInsertableObject($object_to_fill = null, $props_to_skip = array()) { if (is_null($object_to_fill)) { $object_to_fill = new CodeCuePoint(); } return parent::toInsertableObject($object_to_fill, $props_to_skip); }