當前位置: 首頁>>代碼示例>>PHP>>正文


PHP assetPeer::countThumbnailsByEntryId方法代碼示例

本文整理匯總了PHP中assetPeer::countThumbnailsByEntryId方法的典型用法代碼示例。如果您正苦於以下問題:PHP assetPeer::countThumbnailsByEntryId方法的具體用法?PHP assetPeer::countThumbnailsByEntryId怎麽用?PHP assetPeer::countThumbnailsByEntryId使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在assetPeer的用法示例。


在下文中一共展示了assetPeer::countThumbnailsByEntryId方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: setContentAction

 /**
  * Update content of thumbnail asset
  *
  * @action setContent
  * @param string $id
  * @param KalturaContentResource $contentResource
  * @return KalturaThumbAsset
  * @throws KalturaErrors::THUMB_ASSET_ID_NOT_FOUND
  * @throws KalturaErrors::UPLOAD_TOKEN_INVALID_STATUS_FOR_ADD_ENTRY
  * @throws KalturaErrors::UPLOADED_FILE_NOT_FOUND_BY_TOKEN
  * @throws KalturaErrors::RECORDED_WEBCAM_FILE_NOT_FOUND
  * @throws KalturaErrors::THUMB_ASSET_ID_NOT_FOUND
  * @throws KalturaErrors::STORAGE_PROFILE_ID_NOT_FOUND
  * @throws KalturaErrors::RESOURCE_TYPE_NOT_SUPPORTED
  * @validateUser asset::entry id edit 
  */
 function setContentAction($id, KalturaContentResource $contentResource)
 {
     $dbThumbAsset = assetPeer::retrieveById($id);
     if (!$dbThumbAsset || !$dbThumbAsset instanceof thumbAsset) {
         throw new KalturaAPIException(KalturaErrors::THUMB_ASSET_ID_NOT_FOUND, $id);
     }
     $dbEntry = $dbThumbAsset->getentry();
     if (!$dbEntry) {
         throw new KalturaAPIException(KalturaErrors::ENTRY_ID_NOT_FOUND, $dbThumbAsset->getEntryId());
     }
     $previousStatus = $dbThumbAsset->getStatus();
     $contentResource->validateEntry($dbThumbAsset->getentry());
     $contentResource->validateAsset($dbThumbAsset);
     $kContentResource = $contentResource->toObject();
     $this->attachContentResource($dbThumbAsset, $kContentResource);
     $contentResource->entryHandled($dbThumbAsset->getentry());
     kEventsManager::raiseEvent(new kObjectDataChangedEvent($dbThumbAsset));
     $newStatuses = array(thumbAsset::ASSET_STATUS_READY, thumbAsset::ASSET_STATUS_VALIDATING, thumbAsset::ASSET_STATUS_TEMP);
     if ($previousStatus == thumbAsset::ASSET_STATUS_QUEUED && in_array($dbThumbAsset->getStatus(), $newStatuses)) {
         kEventsManager::raiseEvent(new kObjectAddedEvent($dbThumbAsset));
     }
     $thumbAssetsCount = assetPeer::countThumbnailsByEntryId($dbThumbAsset->getEntryId());
     $defaultThumbKey = $dbEntry->getSyncKey(entry::FILE_SYNC_ENTRY_SUB_TYPE_THUMB);
     //If the thums has the default tag or the entry is in no content and this is the first thumb
     if ($dbEntry->getCreateThumb() && ($dbThumbAsset->hasTag(thumbParams::TAG_DEFAULT_THUMB) || $dbEntry->getStatus() == KalturaEntryStatus::NO_CONTENT && $thumbAssetsCount == 1 && !kFileSyncUtils::fileSync_exists($defaultThumbKey))) {
         $this->setAsDefaultAction($dbThumbAsset->getId());
     }
     $thumbAsset = new KalturaThumbAsset();
     $thumbAsset->fromObject($dbThumbAsset);
     return $thumbAsset;
 }
開發者ID:EfncoPlugins,項目名稱:Media-Management-based-on-Kaltura,代碼行數:47,代碼來源:ThumbAssetService.php


注:本文中的assetPeer::countThumbnailsByEntryId方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。