本文整理汇总了PHP中assetPeer::retrieveFlavorsByEntryIdAndStatus方法的典型用法代码示例。如果您正苦于以下问题:PHP assetPeer::retrieveFlavorsByEntryIdAndStatus方法的具体用法?PHP assetPeer::retrieveFlavorsByEntryIdAndStatus怎么用?PHP assetPeer::retrieveFlavorsByEntryIdAndStatus使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类assetPeer
的用法示例。
在下文中一共展示了assetPeer::retrieveFlavorsByEntryIdAndStatus方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getEntrySyncKeys
/**
* @param entry $entry
* @return array<FileSyncKey>
*/
protected static function getEntrySyncKeys(entry $entry, StorageProfile $externalStorage)
{
$exportFileSyncsKeys = array();
$exportFileSyncsKeys[] = $entry->getSyncKey(entry::FILE_SYNC_ENTRY_SUB_TYPE_DATA);
$exportFileSyncsKeys[] = $entry->getSyncKey(entry::FILE_SYNC_ENTRY_SUB_TYPE_ISM);
$exportFileSyncsKeys[] = $entry->getSyncKey(entry::FILE_SYNC_ENTRY_SUB_TYPE_ISMC);
$flavorAssets = array();
$flavorParamsIds = $externalStorage->getFlavorParamsIds();
KalturaLog::log(__METHOD__ . " flavorParamsIds [{$flavorParamsIds}]");
$relevantStatuses = array(asset::ASSET_STATUS_READY, asset::ASSET_STATUS_EXPORTING);
if (is_null($flavorParamsIds) || !strlen(trim($flavorParamsIds))) {
$flavorAssets = assetPeer::retrieveFlavorsByEntryIdAndStatus($entry->getId(), null, $relevantStatuses);
} else {
$flavorParamsArr = explode(',', $flavorParamsIds);
KalturaLog::log(__METHOD__ . " flavorParamsIds count [" . count($flavorParamsArr) . "]");
$flavorAssets = assetPeer::retrieveFlavorsByEntryIdAndStatus($entry->getId(), $flavorParamsArr, $relevantStatuses);
}
foreach ($flavorAssets as $flavorAsset) {
if ($externalStorage->shouldExportFlavorAsset($flavorAsset)) {
$exportFileSyncsKeys[] = $flavorAsset->getSyncKey(flavorAsset::FILE_SYNC_FLAVOR_ASSET_SUB_TYPE_ASSET);
} else {
KalturaLog::log('Flavor asset id [' . $flavorAsset->getId() . '] should not be exported');
}
}
return $exportFileSyncsKeys;
}
示例2: getReadyFlavorAssetIds
/**
* @return array comma separated ID
*/
public function getReadyFlavorAssetIds()
{
$flavorAssetIds = array();
$entryFlavors = assetPeer::retrieveFlavorsByEntryIdAndStatus($this->getId(), null, array(flavorAsset::ASSET_STATUS_READY));
if ($entryFlavors && is_array($entryFlavors)) {
foreach ($entryFlavors as $entryFlavor) {
$flavorAssetIds[] = $entryFlavor->getId();
}
}
return $flavorAssetIds;
}
示例3: 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);
}
示例4: 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);
}
示例5: deleteExportedEntry
/**
*
* for each one of the assets and additional entry files check if it was exported to the external storage
* and add DeleteStorage job
*
* @param entry $entry
* @param StorageProfile $profile
*/
public static function deleteExportedEntry(entry $entry, StorageProfile $profile)
{
$flavorAssets = assetPeer::retrieveFlavorsByEntryIdAndStatus($entry->getId(), null, array(asset::ASSET_STATUS_READY, asset::ASSET_STATUS_EXPORTING));
foreach ($flavorAssets as $flavorAsset) {
$key = $flavorAsset->getSyncKey(flavorAsset::FILE_SYNC_FLAVOR_ASSET_SUB_TYPE_ASSET);
if ($profile->isExported($key)) {
self::delete($entry, $profile, $key);
}
$key = $flavorAsset->getSyncKey(flavorAsset::FILE_SYNC_ASSET_SUB_TYPE_ISM);
if ($profile->isExported($key)) {
self::delete($entry, $profile, $key);
}
$key = $flavorAsset->getSyncKey(flavorAsset::FILE_SYNC_ASSET_SUB_TYPE_ISMC);
if ($profile->isExported($key)) {
self::delete($entry, $profile, $key);
}
}
self::deleteAdditionalEntryFilesFromStorage($entry, $profile);
}