public function toInsertableObject($object_to_fill = null, $props_to_skip = array())
 {
     if (is_null($object_to_fill)) {
         $object_to_fill = new EventCuePoint();
     }
     return parent::toInsertableObject($object_to_fill, $props_to_skip);
 }
 public function validateForUpdate($sourceObject, $propertiesToSkip = array())
 {
     if (!is_null($this->endTime)) {
         $this->validateEndTime($sourceObject->getId());
     }
     return parent::validateForUpdate($sourceObject, $propertiesToSkip);
 }
 public function validateForInsert($propertiesToSkip = array())
 {
     if ($this->assetId !== null) {
         $this->validateTimedThumbAssetId();
     }
     parent::validateForInsert($propertiesToSkip);
 }
 public function validateForInsert($propertiesToSkip = array())
 {
     parent::validateForInsert($propertiesToSkip);
     $dbEntry = entryPeer::retrieveByPK($this->entryId);
     QuizPlugin::validateAndGetQuiz($dbEntry);
     if (!QuizPlugin::validateUserEntitledForQuizEdit($dbEntry)) {
         throw new KalturaAPIException(KalturaErrors::INVALID_USER_ID);
     }
 }
 public function validateForInsert($propertiesToSkip = array())
 {
     parent::validateForInsert($propertiesToSkip);
     $dbEntry = entryPeer::retrieveByPK($this->entryId);
     QuizPlugin::validateAndGetQuiz($dbEntry);
     if (!QuizPlugin::validateUserEntitledForQuizEdit($dbEntry)) {
         KalturaLog::debug('Update quiz questions is allowed only with admin KS or entry owner or co-editor');
         throw new KalturaAPIException(KalturaErrors::INVALID_USER_ID);
     }
 }
 public static function fromDbArray($arr, KalturaDetachedResponseProfile $responseProfile = null)
 {
     $newArr = new KalturaCuePointArray();
     if ($arr == null) {
         return $newArr;
     }
     foreach ($arr as $obj) {
         $nObj = KalturaCuePoint::getInstance($obj, $responseProfile);
         $newArr[] = $nObj;
     }
     return $newArr;
 }
 public function validateForUpdate($sourceObject, $propertiesToSkip = array())
 {
     if ($this->parentId !== null) {
         $this->validateParentId($sourceObject->getId());
     }
     if ($this->text !== null) {
         $this->validatePropertyMaxLength("text", CuePointPeer::MAX_TEXT_LENGTH);
     }
     if (!is_null($this->startTime) || !is_null($this->endTime)) {
         $this->validateEndTime($sourceObject->getId());
     }
     return parent::validateForUpdate($sourceObject, $propertiesToSkip);
 }
 public static function fromDbArray($arr)
 {
     $newArr = new KalturaCuePointArray();
     if ($arr == null) {
         return $newArr;
     }
     foreach ($arr as $obj) {
         $nObj = KalturaCuePoint::getInstance($obj->getType());
         $nObj->fromObject($obj);
         $newArr[] = $nObj;
     }
     return $newArr;
 }
 public function validateForUpdate($sourceObject, $propertiesToSkip = array())
 {
     parent::validateForUpdate($sourceObject, $propertiesToSkip);
     $dbEntry = entryPeer::retrieveByPK($this->entryId);
     $kQuiz = QuizPlugin::validateAndGetQuiz($dbEntry);
     $this->validateUserEntry();
     if (!$kQuiz->getAllowAnswerUpdate()) {
         throw new KalturaAPIException(KalturaQuizErrors::ANSWER_UPDATE_IS_NOT_ALLOWED, $sourceObject->getEntryId());
     }
 }
Beispiel #10
0
 /**
  * Update cue point by id 
  * 
  * @action update
  * @param string $id
  * @param KalturaCuePoint $cuePoint
  * @return KalturaCuePoint
  * @throws KalturaCuePointErrors::INVALID_CUE_POINT_ID
  * @validateUser CuePoint id editcuepoint
  */
 function updateAction($id, KalturaCuePoint $cuePoint)
 {
     $dbCuePoint = CuePointPeer::retrieveByPK($id);
     if (!$dbCuePoint) {
         throw new KalturaAPIException(KalturaCuePointErrors::INVALID_CUE_POINT_ID, $id);
     }
     if ($this->getCuePointType() && $dbCuePoint->getType() != $this->getCuePointType()) {
         throw new KalturaAPIException(KalturaCuePointErrors::INVALID_CUE_POINT_ID, $id);
     }
     if ($cuePoint->systemName) {
         $existingCuePoint = CuePointPeer::retrieveBySystemName($dbCuePoint->getEntryId(), $cuePoint->systemName);
         if ($existingCuePoint && $existingCuePoint->getId() != $id) {
             throw new KalturaAPIException(KalturaCuePointErrors::CUE_POINT_SYSTEM_NAME_EXISTS, $cuePoint->systemName, $existingCuePoint->getId());
         }
     }
     $dbCuePoint = $cuePoint->toUpdatableObject($dbCuePoint);
     $this->validateUserLog($dbCuePoint);
     $dbCuePoint->setKuserId($this->getKuser()->getId());
     $dbCuePoint->save();
     $cuePoint->fromObject($dbCuePoint, $this->getResponseProfile());
     return $cuePoint;
 }
 function update($id, KalturaCuePoint $cuePoint)
 {
     $kparams = array();
     $this->client->addParam($kparams, "id", $id);
     $this->client->addParam($kparams, "cuePoint", $cuePoint->toParams());
     $this->client->queueServiceActionCall("cuepoint_cuepoint", "update", $kparams);
     if ($this->client->isMultiRequest()) {
         return $this->client->getMultiRequestResult();
     }
     $resultObject = $this->client->doQueue();
     $this->client->throwExceptionIfError($resultObject);
     $this->client->validateObjectType($resultObject, "KalturaCuePoint");
     return $resultObject;
 }
Beispiel #12
0
 public function validateForUpdate($sourceObject, $propertiesToSkip = array())
 {
     /* @var $sourceObject Annotation */
     if (!$this->isNull('text')) {
         $this->validatePropertyMaxLength("text", CuePointPeer::MAX_TEXT_LENGTH);
     }
     if ($this->parentId) {
         $this->validateParentId($sourceObject->getId());
     }
     if ($this->parentId || $sourceObject->getParentId()) {
         $this->validateEndTime($sourceObject);
     }
     return parent::validateForUpdate($sourceObject, $propertiesToSkip);
 }
Beispiel #13
0
 public function validateForUpdate($sourceObject, $propertiesToSkip = array())
 {
     $this->validateEndTime($sourceObject);
     return parent::validateForUpdate($sourceObject, $propertiesToSkip);
 }