当前位置: 首页>>代码示例>>PHP>>正文


PHP asset::getFlavorParamsId方法代码示例

本文整理汇总了PHP中asset::getFlavorParamsId方法的典型用法代码示例。如果您正苦于以下问题:PHP asset::getFlavorParamsId方法的具体用法?PHP asset::getFlavorParamsId怎么用?PHP asset::getFlavorParamsId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在asset的用法示例。


在下文中一共展示了asset::getFlavorParamsId方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
 }
开发者ID:DBezemer,项目名称:server,代码行数:35,代码来源:kContextDataHelper.php

示例2: 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);
 }
开发者ID:wzur,项目名称:server,代码行数:53,代码来源:kContextDataHelper.php

示例3: enforceDelivery

 /**
  * Ensure the request for media arrived in a way approved by the partner.
  * this may include restricting to a specific cdn, enforcing token usage etc..
  * Die in case of a breach.
  * 
  * @param entry $entry
  * @param asset $asset
  */
 public static function enforceDelivery($entry, $asset = null)
 {
     // block inactive partner
     $partnerId = $entry->getPartnerId();
     self::blockInactivePartner($partnerId);
     // validate serve access control
     $flavorParamsId = $asset ? $asset->getFlavorParamsId() : null;
     $secureEntryHelper = new KSecureEntryHelper($entry, null, null, ContextType::SERVE);
     $secureEntryHelper->validateForServe($flavorParamsId);
     // enforce delivery
     $partner = PartnerPeer::retrieveByPK($partnerId);
     // Note: Partner was already loaded by blockInactivePartner, no need to check for null
     $restricted = DeliveryProfilePeer::isRequestRestricted($partner);
     if ($restricted) {
         KalturaLog::log("DELIVERY_METHOD_NOT_ALLOWED partner [{$partnerId}]");
         KExternalErrors::dieError(KExternalErrors::DELIVERY_METHOD_NOT_ALLOWED);
     }
 }
开发者ID:dozernz,项目名称:server,代码行数:26,代码来源:myPartnerUtils.class.php

示例4: isAssetAllowed

 public function isAssetAllowed(asset $asset)
 {
     if ($this->ks && $this->ks->verifyPrivileges(ks::PRIVILEGE_DOWNLOAD_ASSET, $asset->getId())) {
         return true;
     }
     return $this->isFlavorParamsAllowed($asset->getFlavorParamsId());
 }
开发者ID:dozernz,项目名称:server,代码行数:7,代码来源:KSecureEntryHelper.class.php


注:本文中的asset::getFlavorParamsId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。