當前位置: 首頁>>代碼示例>>PHP>>正文


PHP ContentDistributionPlugin::isAllowedPartner方法代碼示例

本文整理匯總了PHP中ContentDistributionPlugin::isAllowedPartner方法的典型用法代碼示例。如果您正苦於以下問題:PHP ContentDistributionPlugin::isAllowedPartner方法的具體用法?PHP ContentDistributionPlugin::isAllowedPartner怎麽用?PHP ContentDistributionPlugin::isAllowedPartner使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在ContentDistributionPlugin的用法示例。


在下文中一共展示了ContentDistributionPlugin::isAllowedPartner方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: initService

 public function initService($serviceId, $serviceName, $actionName)
 {
     parent::initService($serviceId, $serviceName, $actionName);
     $this->applyPartnerFilterForClass('GenericDistributionProvider');
     if (!ContentDistributionPlugin::isAllowedPartner($this->getPartnerId())) {
         throw new KalturaAPIException(KalturaErrors::FEATURE_FORBIDDEN, ContentDistributionPlugin::PLUGIN_NAME);
     }
 }
開發者ID:DBezemer,項目名稱:server,代碼行數:8,代碼來源:DistributionProviderService.php

示例2: initService

 public function initService($serviceId, $serviceName, $actionName)
 {
     parent::initService($serviceId, $serviceName, $actionName);
     myPartnerUtils::addPartnerToCriteria(new GenericDistributionProviderActionPeer(), $this->getPartnerId(), $this->private_partner_data, $this->partnerGroup());
     if (!ContentDistributionPlugin::isAllowedPartner(kCurrentContext::$master_partner_id)) {
         throw new KalturaAPIException(KalturaErrors::SERVICE_FORBIDDEN, $this->serviceName . '->' . $this->actionName);
     }
 }
開發者ID:richhl,項目名稱:kalturaCE,代碼行數:8,代碼來源:GenericDistributionProviderActionService.php

示例3: initService

 public function initService($serviceId, $serviceName, $actionName)
 {
     parent::initService($serviceId, $serviceName, $actionName);
     if ($this->getPartnerId() != Partner::ADMIN_CONSOLE_PARTNER_ID) {
         $this->applyPartnerFilterForClass('GenericDistributionProvider');
     }
     if (!ContentDistributionPlugin::isAllowedPartner(kCurrentContext::$master_partner_id)) {
         throw new KalturaAPIException(KalturaErrors::FEATURE_FORBIDDEN, ContentDistributionPlugin::PLUGIN_NAME);
     }
 }
開發者ID:DBezemer,項目名稱:server,代碼行數:10,代碼來源:GenericDistributionProviderService.php

示例4: initService

 public function initService($serviceId, $serviceName, $actionName)
 {
     parent::initService($serviceId, $serviceName, $actionName);
     if ($this->getPartnerId() != Partner::ADMIN_CONSOLE_PARTNER_ID) {
         myPartnerUtils::addPartnerToCriteria(new GenericDistributionProviderPeer(), $this->getPartnerId(), $this->private_partner_data, $this->partnerGroup());
     }
     if (!ContentDistributionPlugin::isAllowedPartner($this->getPartnerId())) {
         throw new KalturaAPIException(KalturaErrors::SERVICE_FORBIDDEN, $this->serviceName . '->' . $this->actionName);
     }
 }
開發者ID:richhl,項目名稱:kalturaCE,代碼行數:10,代碼來源:DistributionProviderService.php

示例5: getEntrySearchValues

 public static function getEntrySearchValues(entry $entry)
 {
     if (!ContentDistributionPlugin::isAllowedPartner($entry->getPartnerId())) {
         return null;
     }
     $entryDistributions = EntryDistributionPeer::retrieveByEntryId($entry->getId());
     if (!count($entryDistributions)) {
         return self::getSearchStringNoDistributionProfiles();
     }
     $searchValues = array();
     foreach ($entryDistributions as $entryDistribution) {
         $distributionProfileId = $entryDistribution->getDistributionProfileId();
         $searchValues[] = self::getSearchStringDistributionProfile($distributionProfileId);
         $searchValues[] = self::getSearchStringDistributionStatus($entryDistribution->getStatus(), $distributionProfileId);
         $searchValues[] = self::getSearchStringDistributionFlag($entryDistribution->getDirtyStatus(), $distributionProfileId);
         $searchValues[] = self::getSearchStringDistributionSunStatus($entryDistribution->getSunStatus(), $distributionProfileId);
         $validationErrors = $entryDistribution->getValidationErrors();
         if (count($validationErrors)) {
             $searchValues[] = self::getSearchStringDistributionHasValidationError($distributionProfileId);
         }
         foreach ($validationErrors as $validationError) {
             $searchValues[] = self::getSearchStringDistributionValidationError($validationError->getErrorType(), $distributionProfileId);
         }
     }
     return implode(' ', $searchValues);
 }
開發者ID:EfncoPlugins,項目名稱:Media-Management-based-on-Kaltura,代碼行數:26,代碼來源:kContentDistributionManager.php

示例6: onAssetReadyOrDeleted

 /**
  * @param asset $asset
  */
 public static function onAssetReadyOrDeleted(asset $asset)
 {
     if (!ContentDistributionPlugin::isAllowedPartner($asset->getPartnerId())) {
         KalturaLog::log("Partner [" . $asset->getPartnerId() . "] is not allowed");
         return true;
     }
     $entry = $asset->getentry();
     if (!$entry) {
         KalturaLog::log("Entry [" . $asset->getEntryId() . "] not found");
         return true;
     }
     $entryDistributions = EntryDistributionPeer::retrieveByEntryId($asset->getEntryId());
     foreach ($entryDistributions as $entryDistribution) {
         $distributionProfileId = $entryDistribution->getDistributionProfileId();
         $distributionProfile = DistributionProfilePeer::retrieveByPK($distributionProfileId);
         if (!$distributionProfile) {
             KalturaLog::log("Entry distribution [" . $entryDistribution->getId() . "] profile [{$distributionProfileId}] not found");
             continue;
         }
         if ($entryDistribution->getStatus() == EntryDistributionStatus::QUEUED || $entryDistribution->getStatus() == EntryDistributionStatus::PENDING) {
             $listChanged = kContentDistributionManager::assignFlavorAssets($entryDistribution, $entry, $distributionProfile);
             $listChanged = $listChanged | kContentDistributionManager::assignThumbAssets($entryDistribution, $entry, $distributionProfile);
             $listChanged = $listChanged | kContentDistributionManager::assignAssets($entryDistribution, $entry, $distributionProfile);
             if (!$listChanged) {
                 KalturaLog::log("Entry distribution [" . $entryDistribution->getId() . "] asset lists didn't change");
                 continue;
             }
             $validationErrors = $distributionProfile->validateForSubmission($entryDistribution, DistributionAction::SUBMIT);
             $entryDistribution->setValidationErrorsArray($validationErrors);
             $entryDistribution->save();
             if ($entryDistribution->getStatus() == EntryDistributionStatus::QUEUED) {
                 if ($entryDistribution->getDirtyStatus() != EntryDistributionDirtyStatus::SUBMIT_REQUIRED) {
                     self::submitAddEntryDistribution($entryDistribution, $distributionProfile);
                 }
             }
         }
         // submit
         if ($entryDistribution->getStatus() == EntryDistributionStatus::READY || $entryDistribution->getStatus() == EntryDistributionStatus::ERROR_UPDATING) {
             $distributionProvider = $distributionProfile->getProvider();
             if (!$distributionProvider) {
                 KalturaLog::log("Entry distribution [" . $entryDistribution->getId() . "] provider not found");
                 continue;
             }
             if (!$distributionProvider->isUpdateEnabled() || !$distributionProvider->isMediaUpdateEnabled()) {
                 KalturaLog::log("Entry distribution [" . $entryDistribution->getId() . "] provider [" . $distributionProvider->getName() . "] does not support update");
                 continue;
             }
             $listChanged = kContentDistributionManager::assignFlavorAssets($entryDistribution, $entry, $distributionProfile);
             $listChanged = $listChanged | kContentDistributionManager::assignThumbAssets($entryDistribution, $entry, $distributionProfile);
             $listChanged = $listChanged | kContentDistributionManager::assignAssets($entryDistribution, $entry, $distributionProfile);
             if (!$listChanged) {
                 KalturaLog::log("Entry distribution [" . $entryDistribution->getId() . "] asset lists didn't change");
                 continue;
             }
             $validationErrors = $distributionProfile->validateForSubmission($entryDistribution, DistributionAction::UPDATE);
             $entryDistribution->setValidationErrorsArray($validationErrors);
             $entryDistribution->save();
             if (!count($validationErrors) && $distributionProfile->getUpdateEnabled() == DistributionProfileActionStatus::AUTOMATIC) {
                 self::submitUpdateEntryDistribution($entryDistribution, $distributionProfile);
             } else {
                 KalturaLog::log("Entry distribution [" . $entryDistribution->getId() . "] should not be updated automatically");
                 $entryDistribution->setDirtyStatus(EntryDistributionDirtyStatus::UPDATE_REQUIRED);
                 $entryDistribution->save();
                 continue;
             }
         }
         // update
     }
     return true;
 }
開發者ID:EfncoPlugins,項目名稱:Media-Management-based-on-Kaltura,代碼行數:73,代碼來源:kContentDistributionFlowManager.php

示例7: onAssetReadyOrDeleted

 /**
  * @param asset $asset
  */
 public static function onAssetReadyOrDeleted(asset $asset)
 {
     if (!ContentDistributionPlugin::isAllowedPartner($asset->getPartnerId())) {
         return true;
     }
     $entry = $asset->getentry();
     if (!$entry) {
         return true;
     }
     $entryDistributions = EntryDistributionPeer::retrieveByEntryId($asset->getEntryId());
     foreach ($entryDistributions as $entryDistribution) {
         $distributionProfileId = $entryDistribution->getDistributionProfileId();
         $distributionProfile = DistributionProfilePeer::retrieveByPK($distributionProfileId);
         if (!$distributionProfile) {
             continue;
         }
         $validateStatuses = array(EntryDistributionStatus::QUEUED, EntryDistributionStatus::PENDING, EntryDistributionStatus::READY);
         if (!in_array($entryDistribution->getStatus(), $validateStatuses)) {
             continue;
         }
         /* 
          * we have special thumbnail definition for 'main menu' & 'thank you' entries 
          * so we need to revalidate avn distribution profile because those thumbnails are not 
          * defined in the distribution porofile so automatic revalidation doesn't work
          */
         if ($distributionProfile instanceof AvnDistributionProfile) {
             $validationErrors = $distributionProfile->validateForSubmission($entryDistribution, DistributionAction::SUBMIT);
             $entryDistribution->setValidationErrorsArray($validationErrors);
             $entryDistribution->save();
         }
     }
     return true;
 }
開發者ID:DBezemer,項目名稱:server,代碼行數:36,代碼來源:kAvnFlowManager.php


注:本文中的ContentDistributionPlugin::isAllowedPartner方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。