本文整理汇总了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;
}