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


PHP assetParamsPeer::resetInstanceCriteriaFilter方法代码示例

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


在下文中一共展示了assetParamsPeer::resetInstanceCriteriaFilter方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: copyConversionProfiles

 public static function copyConversionProfiles(Partner $fromPartner, Partner $toPartner)
 {
     $copiedList = array();
     KalturaLog::log("copyConversionProfiles - Copying conversion profiles from partner [" . $fromPartner->getId() . "] to partner [" . $toPartner->getId() . "]");
     $c = new Criteria();
     $c->add(conversionProfile2Peer::PARTNER_ID, $fromPartner->getId());
     $conversionProfiles = conversionProfile2Peer::doSelect($c);
     foreach ($conversionProfiles as $conversionProfile) {
         $newConversionProfile = $conversionProfile->copy();
         $newConversionProfile->setPartnerId($toPartner->getId());
         $newConversionProfile->save();
         KalturaLog::log("copyConversionProfiles - Copied [" . $conversionProfile->getId() . "], new id is [" . $newConversionProfile->getId() . "]");
         $copiedList[$conversionProfile->getId()] = $newConversionProfile->getId();
         $c = new Criteria();
         $c->add(flavorParamsConversionProfilePeer::CONVERSION_PROFILE_ID, $conversionProfile->getId());
         $fpcpList = flavorParamsConversionProfilePeer::doSelect($c);
         foreach ($fpcpList as $fpcp) {
             $flavorParamsId = $fpcp->getFlavorParamsId();
             assetParamsPeer::resetInstanceCriteriaFilter();
             $flavorParams = assetParamsPeer::retrieveByPK($flavorParamsId);
             if ($flavorParams && $flavorParams->getPartnerId() === 0) {
                 $newFpcp = $fpcp->copy();
                 $newFpcp->setConversionProfileId($newConversionProfile->getId());
                 $newFpcp->save();
             }
         }
     }
     $toPartner->save();
     // make sure conversion profile is set on the new partner in case it was missed/skiped in the conversionProfile2::copy method
     if (!$toPartner->getDefaultConversionProfileId()) {
         $fromPartnerDefaultProfile = $fromPartner->getDefaultConversionProfileId();
         if ($fromPartnerDefaultProfile && key_exists($fromPartnerDefaultProfile, $copiedList)) {
             $toPartner->setDefaultConversionProfileId($copiedList[$fromPartnerDefaultProfile]);
             $toPartner->save();
         }
     }
 }
开发者ID:richhl,项目名称:kalturaCE,代码行数:37,代码来源:myPartnerUtils.class.php

示例2: validateFlavorParamsIds

 public function validateFlavorParamsIds()
 {
     $flavorParamsIds = $this->getFlavorParamsAsArray();
     assetParamsPeer::resetInstanceCriteriaFilter();
     $flavorParams = assetParamsPeer::retrieveByPKs($flavorParamsIds);
     $sourceFound = false;
     $indexedFlavorParams = array();
     foreach ($flavorParams as $flavorParamsItem) {
         if ($flavorParamsItem->hasTag(flavorParams::TAG_SOURCE)) {
             if ($sourceFound) {
                 throw new KalturaAPIException(KalturaErrors::FLAVOR_PARAMS_SOURCE_DUPLICATE);
             }
             $sourceFound = true;
         }
         $indexedFlavorParams[$flavorParamsItem->getId()] = $flavorParamsItem;
     }
     $foundFlavorParams = array();
     foreach ($flavorParamsIds as $id) {
         if (!isset($indexedFlavorParams[$id])) {
             throw new KalturaAPIException(KalturaErrors::FLAVOR_PARAMS_ID_NOT_FOUND, $id);
         }
         if (in_array($id, $foundFlavorParams)) {
             throw new KalturaAPIException(KalturaErrors::FLAVOR_PARAMS_DUPLICATE, $id);
         }
         $foundFlavorParams[] = $id;
     }
 }
开发者ID:richhl,项目名称:kalturaCE,代码行数:27,代码来源:KalturaConversionProfile.php


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