本文整理匯總了PHP中assetPeer::retrieveLocalReadyByEntryIdAndFlavorParams方法的典型用法代碼示例。如果您正苦於以下問題:PHP assetPeer::retrieveLocalReadyByEntryIdAndFlavorParams方法的具體用法?PHP assetPeer::retrieveLocalReadyByEntryIdAndFlavorParams怎麽用?PHP assetPeer::retrieveLocalReadyByEntryIdAndFlavorParams使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類assetPeer
的用法示例。
在下文中一共展示了assetPeer::retrieveLocalReadyByEntryIdAndFlavorParams方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getSourceFlavorAssets
private static function getSourceFlavorAssets(flavorAsset $flavorAsset, flavorParamsOutput $flavor)
{
$srcFlavorParamsIds = explode(',', trim($flavor->getSourceAssetParamsIds()));
$c = new Criteria();
$c->add(assetPeer::ENTRY_ID, $flavorAsset->getEntryId());
$c->add(assetPeer::STATUS, array(flavorAsset::ASSET_STATUS_READY, flavorAsset::ASSET_STATUS_NOT_APPLICABLE, flavorAsset::ASSET_STATUS_EXPORTING), Criteria::IN);
$c->add(assetPeer::FLAVOR_PARAMS_ID, $srcFlavorParamsIds, Criteria::IN);
$readyAndNonApplicableAssetsCount = assetPeer::doCount($c);
KalturaLog::info('Verify source flavors are ready: number of ready and NA assets [' . $readyAndNonApplicableAssetsCount . '], number of source params ids [' . count($srcFlavorParamsIds) . ']');
if ($readyAndNonApplicableAssetsCount < count($srcFlavorParamsIds)) {
KalturaLog::info('Not all source flavors are ready, changing status to WAIT_FOR_CONVERT');
$flavorAsset->setStatus(flavorAsset::ASSET_STATUS_WAIT_FOR_CONVERT);
$flavorAsset->setDescription("Source flavor assets are not ready");
$flavorAsset->save();
return false;
}
$srcFlavors = assetPeer::retrieveLocalReadyByEntryIdAndFlavorParams($flavorAsset->getEntryId(), $srcFlavorParamsIds);
if (!count($srcFlavors)) {
//assuming all source flavors are Not Applicable
KalturaLog::log("Flavor [" . $flavorAsset->getFlavorParamsId() . "] is set to N/A since all it's sources are N/A");
$flavorAsset->setStatus(flavorAsset::ASSET_STATUS_NOT_APPLICABLE);
$flavorAsset->save();
return false;
}
return $srcFlavors;
}