本文整理匯總了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;
}