本文整理汇总了PHP中assetPeer::retrieveReadyFlavorsIdsByEntryId方法的典型用法代码示例。如果您正苦于以下问题:PHP assetPeer::retrieveReadyFlavorsIdsByEntryId方法的具体用法?PHP assetPeer::retrieveReadyFlavorsIdsByEntryId怎么用?PHP assetPeer::retrieveReadyFlavorsIdsByEntryId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类assetPeer
的用法示例。
在下文中一共展示了assetPeer::retrieveReadyFlavorsIdsByEntryId方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: initFlavorIds
protected function initFlavorIds()
{
$flavorIds = $this->getRequestParameter("flavorIds", null);
if (!is_null($flavorIds)) {
$this->flavorIds = explode(',', $flavorIds);
}
$flavorId = $this->getRequestParameter("flavorId", null);
if (!is_null($flavorId)) {
$this->flavorIds = array($flavorId);
}
if (!is_null($this->flavorIds)) {
return;
}
$flavorParamIds = $this->getRequestParameter("flavorParamIds", null);
if (!is_null($flavorParamIds)) {
$this->flavorParamsIds = explode(',', $flavorParamIds);
}
$flavorParamId = $this->getRequestParameter("flavorParamId", null);
if (!is_null($flavorParamId)) {
$this->flavorParamsIds = array($flavorParamId);
}
if (is_null($this->flavorParamsIds)) {
return;
}
$this->flavorParamsIds = $this->secureEntryHelper->filterAllowedFlavorParams($this->flavorParamsIds);
if (is_null($this->flavorParamsIds)) {
return;
}
$this->flavorIds = assetPeer::retrieveReadyFlavorsIdsByEntryId($this->entryId, $this->flavorParamsIds);
}
示例2: assignFlavorAssets
/**
* @param EntryDistribution $entryDistribution
* @param entry $entry
* @param DistributionProfile $distributionProfile
* @return boolean true if the list of flavors modified
*/
public static function assignFlavorAssets(EntryDistribution $entryDistribution, entry $entry, DistributionProfile $distributionProfile)
{
$submittingStatuses = array(EntryDistributionStatus::PENDING, EntryDistributionStatus::QUEUED, EntryDistributionStatus::SUBMITTING, EntryDistributionStatus::IMPORT_SUBMITTING, EntryDistributionStatus::ERROR_SUBMITTING);
// if not in first submmiting status then it's an update and need to check if update is supported.
if (!in_array($entryDistribution->getStatus(), $submittingStatuses)) {
$distributionProvider = $distributionProfile->getProvider();
if (!$distributionProvider) {
KalturaLog::log("Entry distribution [" . $entryDistribution->getId() . "] provider not found");
return false;
}
if (!$distributionProvider->isUpdateEnabled() || !$distributionProvider->isMediaUpdateEnabled()) {
KalturaLog::log("Entry distribution [" . $entryDistribution->getId() . "] provider [" . $distributionProvider->getName() . "] does not support update");
return false;
}
}
$requiredFlavorParamsIds = $distributionProfile->getRequiredFlavorParamsIdsArray();
$optionalFlavorParamsIds = $distributionProfile->getOptionalFlavorParamsIdsArray();
$flavorParamsIds = array_merge($requiredFlavorParamsIds, $optionalFlavorParamsIds);
$flavorAssetIds = array();
if (!is_array($flavorParamsIds)) {
return false;
}
$originalList = $entryDistribution->getFlavorAssetIds();
// remove deleted flavor assets
if ($originalList) {
$assignedFlavorAssetIds = explode(',', $originalList);
$assignedFlavorAssets = assetPeer::retrieveByIds($assignedFlavorAssetIds);
foreach ($assignedFlavorAssets as $assignedFlavorAsset) {
if (in_array($assignedFlavorAsset->getFlavorParamsId(), $flavorParamsIds)) {
$flavorAssetIds[] = $assignedFlavorAsset->getId();
}
}
}
// adds added flavor assets
$newFlavorAssetIds = assetPeer::retrieveReadyFlavorsIdsByEntryId($entry->getId(), $flavorParamsIds);
foreach ($newFlavorAssetIds as $newFlavorAssetId) {
$flavorAssetIds[] = $newFlavorAssetId;
}
$entryDistribution->setFlavorAssetIds($flavorAssetIds);
return $originalList != $entryDistribution->getFlavorAssetIds();
}
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:47,代码来源:kContentDistributionManager.php
示例3: initFlavorIds
protected function initFlavorIds()
{
$flavorIdsStr = $this->getRequestParameter("flavorIds", null);
if ($flavorIdsStr) {
$this->flavorIds = explode(",", $flavorIdsStr);
}
$this->flavorId = $this->getRequestParameter("flavorId", null);
if (!$this->flavorId) {
$flavorParamIds = $this->getRequestParameter("flavorParamIds", null);
if ($flavorParamIds !== null) {
$this->flavorIds = assetPeer::retrieveReadyFlavorsIdsByEntryId($this->entry->getId(), explode(",", $flavorParamIds));
if (!$this->flavorIds || count($this->flavorIds) == 0) {
KExternalErrors::dieError(KExternalErrors::FLAVOR_NOT_FOUND);
}
} else {
$flavorParamId = $this->getRequestParameter("flavorParamId", null);
if ($flavorParamId || $flavorParamId === "0") {
$flavorAsset = assetPeer::retrieveByEntryIdAndParams($this->entry->getId(), $flavorParamId);
if (!$flavorAsset) {
KExternalErrors::dieError(KExternalErrors::FLAVOR_NOT_FOUND);
}
$this->flavorId = $flavorAsset->getId();
}
}
}
}