public static function fromDbArray($arr)
 {
     $newArr = new KalturaAttachmentAssetArray();
     if ($arr == null) {
         return $newArr;
     }
     foreach ($arr as $obj) {
         $nObj = new KalturaAttachmentAsset();
         $nObj->fromObject($obj);
         $newArr[] = $nObj;
     }
     return $newArr;
 }
 public static function fromDbArray($arr, KalturaDetachedResponseProfile $responseProfile = null)
 {
     $newArr = new KalturaAttachmentAssetArray();
     if ($arr == null) {
         return $newArr;
     }
     foreach ($arr as $obj) {
         $nObj = new KalturaAttachmentAsset();
         $nObj->fromObject($obj, $responseProfile);
         $newArr[] = $nObj;
     }
     return $newArr;
 }
Example #3
0
 public function toObject($object_to_fill = null, $props_to_skip = array())
 {
     if (!$object_to_fill) {
         $object_to_fill = new TranscriptAsset();
     }
     return parent::toObject($object_to_fill, $props_to_skip);
 }
 /**
  * @action get
  * @param string $attachmentAssetId
  * @return KalturaAttachmentAsset
  * 
  * @throws KalturaAttachmentErrors::ATTACHMENT_ASSET_ID_NOT_FOUND
  */
 public function getAction($attachmentAssetId)
 {
     $attachmentAssetsDb = assetPeer::retrieveById($attachmentAssetId);
     if (!$attachmentAssetsDb || !$attachmentAssetsDb instanceof AttachmentAsset) {
         throw new KalturaAPIException(KalturaAttachmentErrors::ATTACHMENT_ASSET_ID_NOT_FOUND, $attachmentAssetId);
     }
     $attachmentAssets = new KalturaAttachmentAsset();
     $attachmentAssets->fromObject($attachmentAssetsDb);
     return $attachmentAssets;
 }
 function update($id, KalturaAttachmentAsset $attachmentAsset)
 {
     $kparams = array();
     $this->client->addParam($kparams, "id", $id);
     $this->client->addParam($kparams, "attachmentAsset", $attachmentAsset->toParams());
     $this->client->queueServiceActionCall("attachment_attachmentasset", "update", $kparams);
     if ($this->client->isMultiRequest()) {
         return $this->client->getMultiRequestResult();
     }
     $resultObject = $this->client->doQueue();
     $this->client->throwExceptionIfError($resultObject);
     $this->client->validateObjectType($resultObject, "KalturaAttachmentAsset");
     return $resultObject;
 }
 /**
  * Update attachment asset
  *
  * @action update
  * @param string $id
  * @param KalturaAttachmentAsset $attachmentAsset
  * @return KalturaAttachmentAsset
  * @throws KalturaErrors::ENTRY_ID_NOT_FOUND
  * @validateUser asset::entry id edit
  */
 function updateAction($id, KalturaAttachmentAsset $attachmentAsset)
 {
     $dbAttachmentAsset = assetPeer::retrieveById($id);
     if (!$dbAttachmentAsset || !$dbAttachmentAsset instanceof AttachmentAsset) {
         throw new KalturaAPIException(KalturaAttachmentErrors::ATTACHMENT_ASSET_ID_NOT_FOUND, $id);
     }
     $dbEntry = $dbAttachmentAsset->getentry();
     if (!$dbEntry || !in_array($dbEntry->getType(), $this->getEnabledMediaTypes())) {
         throw new KalturaAPIException(KalturaErrors::ENTRY_ID_NOT_FOUND, $dbAttachmentAsset->getEntryId());
     }
     $dbAttachmentAsset = $attachmentAsset->toUpdatableObject($dbAttachmentAsset);
     $dbAttachmentAsset->save();
     $attachmentAsset = KalturaAsset::getInstance($dbAttachmentAsset);
     $attachmentAsset->fromObject($dbAttachmentAsset, $this->getResponseProfile());
     return $attachmentAsset;
 }