public static function fromDbArray($arr) { $newArr = new KalturaAnnotationArray(); if ($arr == null) { return $newArr; } foreach ($arr as $obj) { $nObj = new KalturaAnnotation(); $nObj->fromObject($obj); $newArr[] = $nObj; } return $newArr; }
public static function fromDbArray($arr, KalturaDetachedResponseProfile $responseProfile = null) { $newArr = new KalturaAnnotationArray(); if ($arr == null) { return $newArr; } foreach ($arr as $obj) { $nObj = new KalturaAnnotation(); $nObj->fromObject($obj, $responseProfile); $newArr[] = $nObj; } return $newArr; }
function update($id, KalturaAnnotation $annotation) { $kparams = array(); $this->client->addParam($kparams, "id", $id); $this->client->addParam($kparams, "annotation", $annotation->toParams()); $this->client->queueServiceActionCall("annotation_annotation", "update", $kparams); if ($this->client->isMultiRequest()) { return $this->client->getMultiRequestResult(); } $resultObject = $this->client->doQueue(); $this->client->throwExceptionIfError($resultObject); $this->client->validateObjectType($resultObject, "KalturaAnnotation"); return $resultObject; }
/** * Update annotation by id * * @action update * @param string $id * @param KalturaAnnotation $annotation * @return KalturaAnnotation */ function updateAction($id, KalturaAnnotation $annotation) { kalturalog::debug("annotation service updateAction"); $dbAnnotation = AnnotationPeer::retrieveByPK($id); if ($dbAnnotation->getType() != AnnotationType::ANNOTATION) { throw new KalturaAPIException(KalturaErrors::INVALID_OBJECT_ID, $id); } if (!$dbAnnotation) { throw new KalturaAPIException(KalturaErrors::INVALID_OBJECT_ID, $id); } if ($annotation->text !== null) { $annotation->validatePropertyMaxLength("text", AnnotationPeer::MAX_ANNOTATION_TEXT); } if ($annotation->tags !== null) { $annotation->validatePropertyMaxLength("tags", AnnotationPeer::MAX_ANNOTATION_TAGS); } if ($annotation->entryId !== null) { $annotation->validateEntryId($annotation, $id); } if ($annotation->parentId !== null) { $annotation->validateParentId($annotation, $id); } if ($annotation->startTime !== null) { $annotation->validateStartTime($annotation, $id); } if ($annotation->endTime !== null) { $annotation->validateEndTime($annotation, $id); } $dbAnnotation = $annotation->toUpdatableObject($dbAnnotation); $dbAnnotation->setKuserId($this->getKuser()->getId()); $dbAnnotation->save(); $annotation->fromObject($dbAnnotation); return $annotation; }