public static function fromDbArray($arr, KalturaDetachedResponseProfile $responseProfile = null)
 {
     $newArr = new KalturaFileAssetArray();
     if ($arr == null) {
         return $newArr;
     }
     foreach ($arr as $obj) {
         $nObj = new KalturaFileAsset();
         $nObj->fromObject($obj, $responseProfile);
         $newArr[] = $nObj;
     }
     return $newArr;
 }
Beispiel #2
0
 /**
  * Update file asset by id
  * 
  * @param int $id 
  * @param KalturaFileAsset $fileAsset 
  * @return KalturaFileAsset
  */
 function update($id, KalturaFileAsset $fileAsset)
 {
     $kparams = array();
     $this->client->addParam($kparams, "id", $id);
     $this->client->addParam($kparams, "fileAsset", $fileAsset->toParams());
     $this->client->queueServiceActionCall("fileasset", "update", $kparams);
     if ($this->client->isMultiRequest()) {
         return $this->client->getMultiRequestResult();
     }
     $resultObject = $this->client->doQueue();
     $this->client->throwExceptionIfError($resultObject);
     $this->client->validateObjectType($resultObject, "KalturaFileAsset");
     return $resultObject;
 }
Beispiel #3
0
 /**
  * Set content of file asset
  *
  * @action setContent
  * @param string $id
  * @param KalturaContentResource $contentResource
  * @return KalturaFileAsset
  * @throws KalturaErrors::FILE_ASSET_ID_NOT_FOUND
  * @throws KalturaErrors::UPLOADED_FILE_NOT_FOUND_BY_TOKEN
  * @throws KalturaErrors::RECORDED_WEBCAM_FILE_NOT_FOUND
  * @throws KalturaErrors::RESOURCE_TYPE_NOT_SUPPORTED 
  */
 function setContentAction($id, KalturaContentResource $contentResource)
 {
     $dbFileAsset = FileAssetPeer::retrieveByPK($id);
     if (!$dbFileAsset) {
         throw new KalturaAPIException(KalturaErrors::FILE_ASSET_ID_NOT_FOUND, $id);
     }
     $kContentResource = $contentResource->toObject();
     $this->attachContentResource($dbFileAsset, $kContentResource);
     $fileAsset = new KalturaFileAsset();
     $fileAsset->fromObject($dbFileAsset, $this->getResponseProfile());
     return $fileAsset;
 }