Пример #1
0
 public static function fromDbArray($arr, KalturaDetachedResponseProfile $responseProfile = null)
 {
     $newArr = new KalturaThumbAssetArray();
     if ($arr == null) {
         return $newArr;
     }
     foreach ($arr as $obj) {
         $nObj = KalturaThumbAsset::getInstanceByType($obj->getType());
         $nObj->fromObject($obj, $responseProfile);
         $newArr[] = $nObj;
     }
     return $newArr;
 }
Пример #2
0
 /**
  * @action get
  * @param string $thumbAssetId
  * @return KalturaThumbAsset
  * 
  * @throws KalturaErrors::THUMB_ASSET_ID_NOT_FOUND
  */
 public function getAction($thumbAssetId)
 {
     $thumbAssetsDb = assetPeer::retrieveById($thumbAssetId);
     if (!$thumbAssetsDb || !$thumbAssetsDb instanceof thumbAsset) {
         throw new KalturaAPIException(KalturaErrors::THUMB_ASSET_ID_NOT_FOUND, $thumbAssetId);
     }
     if (kEntitlementUtils::getEntitlementEnforcement()) {
         $entry = entryPeer::retrieveByPK($thumbAssetsDb->getEntryId());
         if (!$entry) {
             //we will throw thumb asset not found, as the user is not entitled, and should not know that the entry exists.
             throw new KalturaAPIException(KalturaErrors::THUMB_ASSET_ID_NOT_FOUND, $thumbAssetId);
         }
     }
     $thumbAssets = KalturaThumbAsset::getInstanceByType($thumbAssetsDb->getType());
     $thumbAssets->fromObject($thumbAssetsDb, $this->getResponseProfile());
     return $thumbAssets;
 }