本文整理汇总了PHP中assetPeer::retrieveReadyByEntryIdAndFlavorParams方法的典型用法代码示例。如果您正苦于以下问题:PHP assetPeer::retrieveReadyByEntryIdAndFlavorParams方法的具体用法?PHP assetPeer::retrieveReadyByEntryIdAndFlavorParams怎么用?PHP assetPeer::retrieveReadyByEntryIdAndFlavorParams使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类assetPeer
的用法示例。
在下文中一共展示了assetPeer::retrieveReadyByEntryIdAndFlavorParams方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setContextDataFlavorAssets
private function setContextDataFlavorAssets($flavorTags)
{
$flavorParamsIds = null;
$flavorParamsNotIn = false;
if (!$this->isAdmin) {
foreach ($this->contextDataResult->getActions() as $action) {
if ($action->getType() == RuleActionType::BLOCK) {
//in case of block action do not set the list of flavors
return;
}
if ($action->getType() == RuleActionType::LIMIT_FLAVORS) {
/* @var $action kAccessControlLimitFlavorsAction */
$flavorParamsIds = explode(',', $action->getFlavorParamsIds());
$flavorParamsNotIn = $action->getIsBlockedList();
}
}
}
$flavorAssets = array();
if (is_null($this->asset)) {
if (count($flavorParamsIds)) {
$flavorAssets = assetPeer::retrieveReadyByEntryIdAndFlavorParams($this->entry->getId(), $flavorParamsIds, $flavorParamsNotIn);
} else {
$flavorAssets = assetPeer::retrieveFlavorsByEntryIdAndStatus($this->entry->getId(), null, array(flavorAsset::ASSET_STATUS_READY));
}
} else {
$flavorAllowed = true;
if (count($flavorParamsIds)) {
$flavorAllowed = $this->isFlavorAllowed($this->asset->getFlavorParamsId(), $flavorParamsIds, $flavorParamsNotIn);
}
if ($flavorAllowed) {
$flavorAssets[] = $this->asset;
}
}
$this->filterFlavorAssetsByTags($flavorAssets, $flavorTags);
}
示例2: addFromEntryAction
/**
* Copy entry into new entry
*
* @action addFromEntry
* @param string $sourceEntryId Media entry id to copy from
* @param KalturaMediaEntry $mediaEntry Media entry metadata
* @param int $sourceFlavorParamsId The flavor to be used as the new entry source, source flavor will be used if not specified
* @return KalturaMediaEntry The new media entry
* @throws KalturaErrors::ENTRY_ID_NOT_FOUND
* @throws KalturaErrors::ORIGINAL_FLAVOR_ASSET_IS_MISSING
* @throws KalturaErrors::FLAVOR_PARAMS_NOT_FOUND
* @throws KalturaErrors::ORIGINAL_FLAVOR_ASSET_NOT_CREATED
*
* @deprecated use media.add instead
*/
function addFromEntryAction($sourceEntryId, KalturaMediaEntry $mediaEntry = null, $sourceFlavorParamsId = null)
{
if ($mediaEntry->conversionQuality && !$mediaEntry->conversionProfileId) {
$mediaEntry->conversionProfileId = $mediaEntry->conversionQuality;
}
$srcEntry = entryPeer::retrieveByPK($sourceEntryId);
if (!$srcEntry || $srcEntry->getType() != entryType::MEDIA_CLIP) {
throw new KalturaAPIException(KalturaErrors::ENTRY_ID_NOT_FOUND, $sourceEntryId);
}
$srcFlavorAsset = null;
if (is_null($sourceFlavorParamsId)) {
$srcFlavorAsset = assetPeer::retrieveOriginalByEntryId($sourceEntryId);
if (!$srcFlavorAsset) {
throw new KalturaAPIException(KalturaErrors::ORIGINAL_FLAVOR_ASSET_IS_MISSING);
}
} else {
$srcFlavorAssets = assetPeer::retrieveReadyByEntryIdAndFlavorParams($sourceEntryId, array($sourceFlavorParamsId));
if (count($srcFlavorAssets)) {
$srcFlavorAsset = reset($srcFlavorAssets);
} else {
throw new KalturaAPIException(KalturaErrors::FLAVOR_PARAMS_NOT_FOUND);
}
}
if ($mediaEntry === null) {
$mediaEntry = new KalturaMediaEntry();
}
$mediaEntry->mediaType = $srcEntry->getMediaType();
return $this->addEntryFromFlavorAsset($mediaEntry, $srcEntry, $srcFlavorAsset);
}
示例3: setContextDataFlavorAssets
private function setContextDataFlavorAssets($flavorTags)
{
if ($this->entry->getType() == entryType::PLAYLIST && $this->entry->getMediaType() == entry::ENTRY_MEDIA_TYPE_TEXT) {
list($entryIds, $durations, $mediaEntry) = myPlaylistUtils::executeStitchedPlaylist($this->entry);
if (!$mediaEntry) {
return;
}
$mediaEntryId = $mediaEntry->getId();
$this->msDuration = array_sum($durations);
} else {
$mediaEntryId = $this->entry->getId();
$this->msDuration = $this->entry->getLengthInMsecs();
}
$flavorParamsIds = null;
$flavorParamsNotIn = false;
if (!$this->isAdmin) {
foreach ($this->contextDataResult->getActions() as $action) {
if ($action->getType() == RuleActionType::BLOCK) {
//in case of block action do not set the list of flavors
return;
}
if ($action->getType() == RuleActionType::LIMIT_FLAVORS) {
/* @var $action kAccessControlLimitFlavorsAction */
$flavorParamsIds = explode(',', $action->getFlavorParamsIds());
$flavorParamsNotIn = $action->getIsBlockedList();
}
}
}
$flavorAssets = array();
if (is_null($this->asset)) {
if (count($flavorParamsIds)) {
$flavorAssets = assetPeer::retrieveReadyByEntryIdAndFlavorParams($mediaEntryId, $flavorParamsIds, $flavorParamsNotIn);
} else {
$flavorAssets = assetPeer::retrieveFlavorsByEntryIdAndStatus($mediaEntryId, null, array(flavorAsset::ASSET_STATUS_READY));
}
if ($mediaEntryId != $this->entry->getId()) {
// hack: setting the entry id of the flavors to the original playlist id
// since the player uses it in the playManifest url
foreach ($flavorAssets as $flavorAsset) {
$flavorAsset->setEntryId($this->entry->getId());
}
}
} else {
$flavorAllowed = true;
if (count($flavorParamsIds)) {
$flavorAllowed = $this->isFlavorAllowed($this->asset->getFlavorParamsId(), $flavorParamsIds, $flavorParamsNotIn);
}
if ($flavorAllowed) {
$flavorAssets[] = $this->asset;
}
}
$this->filterFlavorAssetsByTags($flavorAssets, $flavorTags);
}