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


PHP myPartnerUtils::isPartnerPermittedForCopy方法代碼示例

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


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

示例1: copyEventNotificationTemplates

 /**
  * @param Partner $fromPartner
  * @param Partner $toPartner
  */
 protected function copyEventNotificationTemplates(Partner $fromPartner, Partner $toPartner, $permissionRequiredOnly = false)
 {
     $fromPartnerId = $fromPartner->getId();
     $toPartnerId = $toPartner->getId();
     KalturaLog::debug("Copy event-notification templates from [{$fromPartnerId}] to [{$toPartnerId}]");
     $c = new Criteria();
     $c->add(EventNotificationTemplatePeer::PARTNER_ID, $fromPartnerId);
     $systemNameCriteria = new Criteria();
     $systemNameCriteria->add(EventNotificationTemplatePeer::PARTNER_ID, $toPartnerId);
     $systemNameCriteria->add(EventNotificationTemplatePeer::STATUS, EventNotificationTemplateStatus::ACTIVE);
     $eventNotificationTemplates = EventNotificationTemplatePeer::doSelect($c);
     foreach ($eventNotificationTemplates as $eventNotificationTemplate) {
         /* @var $eventNotificationTemplate EventNotificationTemplate */
         if ($permissionRequiredOnly && !count($eventNotificationTemplate->getRequiredCopyTemplatePermissions())) {
             continue;
         }
         if (!myPartnerUtils::isPartnerPermittedForCopy($toPartner, $eventNotificationTemplate->getRequiredCopyTemplatePermissions())) {
             continue;
         }
         if ($eventNotificationTemplate->getSystemName()) {
             $c = clone $systemNameCriteria;
             $c->add(EventNotificationTemplatePeer::SYSTEM_NAME, $eventNotificationTemplate->getSystemName());
             if (EventNotificationTemplatePeer::doCount($c)) {
                 continue;
             }
         }
         $newEventNotificationTemplate = $eventNotificationTemplate->copy();
         $newEventNotificationTemplate->setPartnerId($toPartnerId);
         $newEventNotificationTemplate->save();
     }
 }
開發者ID:kubrickfr,項目名稱:server,代碼行數:35,代碼來源:kEventNotificationObjectCopiedHandler.php

示例2: copyMetadataProfiles

 /**
  * @param Partner $fromPartner
  * @param Partner $toPartner
  */
 protected function copyMetadataProfiles(Partner $fromPartner, Partner $toPartner, $permissionRequiredOnly = false)
 {
     $fromPartnerId = $fromPartner->getId();
     $toPartnerId = $toPartner->getId();
     KalturaLog::debug("Copy metadata profiles from [{$fromPartnerId}] to [{$toPartnerId}]");
     $c = new Criteria();
     $c->add(MetadataProfilePeer::PARTNER_ID, $fromPartnerId);
     $systemNameCriteria = new Criteria();
     $systemNameCriteria->add(MetadataProfilePeer::PARTNER_ID, $toPartnerId);
     $systemNameCriteria->add(MetadataProfilePeer::STATUS, MetadataProfile::STATUS_ACTIVE);
     $metadataProfiles = MetadataProfilePeer::doSelect($c);
     foreach ($metadataProfiles as $metadataProfile) {
         /* @var $metadataProfile MetadataProfile */
         if ($permissionRequiredOnly && !count($metadataProfile->getRequiredCopyTemplatePermissions())) {
             continue;
         }
         if (!myPartnerUtils::isPartnerPermittedForCopy($toPartner, $metadataProfile->getRequiredCopyTemplatePermissions())) {
             continue;
         }
         if ($metadataProfile->getSystemName()) {
             $c = clone $systemNameCriteria;
             $c->add(MetadataProfilePeer::SYSTEM_NAME, $metadataProfile->getSystemName());
             if (MetadataProfilePeer::doCount($c)) {
                 continue;
             }
         }
         $newMetadataProfile = $metadataProfile->copy();
         $newMetadataProfile->setPartnerId($toPartnerId);
         $newMetadataProfile->save();
         kFileSyncUtils::createSyncFileLinkForKey($newMetadataProfile->getSyncKey(MetadataProfile::FILE_SYNC_METADATA_DEFINITION), $metadataProfile->getSyncKey(MetadataProfile::FILE_SYNC_METADATA_DEFINITION));
         kFileSyncUtils::createSyncFileLinkForKey($newMetadataProfile->getSyncKey(MetadataProfile::FILE_SYNC_METADATA_VIEWS), $metadataProfile->getSyncKey(MetadataProfile::FILE_SYNC_METADATA_VIEWS));
         kFileSyncUtils::createSyncFileLinkForKey($newMetadataProfile->getSyncKey(MetadataProfile::FILE_SYNC_METADATA_XSLT), $metadataProfile->getSyncKey(MetadataProfile::FILE_SYNC_METADATA_XSLT));
         $metadataProfileFields = MetadataProfileFieldPeer::retrieveByMetadataProfileId($metadataProfile->getId());
         foreach ($metadataProfileFields as $metadataProfileField) {
             $newMetadataProfileField = $metadataProfileField->copy();
             $newMetadataProfileField->setMetadataProfileId($newMetadataProfile->getId());
             $newMetadataProfileField->setPartnerId($toPartnerId);
             $newMetadataProfileField->save();
         }
     }
 }
開發者ID:kubrickfr,項目名稱:server,代碼行數:45,代碼來源:kMetadataObjectCopiedHandler.php


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