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


PHP assetParamsPeer::filterPartner方法代码示例

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


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

示例1: addPartnerToCriteria

 public static function addPartnerToCriteria($partnerId, $privatePartnerData = false, $partnerGroup = null, $kalturaNetwork = null)
 {
     self::$filterPartner = $partnerId;
     if (!self::$isDefaultInDefaultCriteria) {
         return parent::addPartnerToCriteria($partnerId, $privatePartnerData, $partnerGroup, $kalturaNetwork);
     }
     $criteriaFilter = self::getCriteriaFilter();
     $criteria = $criteriaFilter->getFilter();
     if (!$privatePartnerData) {
         // the private partner data is not allowed -
         if ($kalturaNetwork) {
             // allow only the kaltura network stuff
             if ($partnerId) {
                 $orderBy = "(" . self::PARTNER_ID . "<>{$partnerId})";
                 // first take the pattner_id and then the rest
                 myCriteria::addComment($criteria, "Only Kaltura Network");
                 $criteria->addAscendingOrderByColumn($orderBy);
                 //, Criteria::CUSTOM );
             }
         } else {
             // no private data and no kaltura_network -
             // add a criteria that will return nothing
             $criteria->addAnd(self::PARTNER_ID, Partner::PARTNER_THAT_DOWS_NOT_EXIST);
         }
     } else {
         // private data is allowed
         if (empty($partnerGroup) && empty($kalturaNetwork)) {
             // the default case
             $criteria->addAnd(self::PARTNER_ID, $partnerId);
         } elseif ($partnerGroup == myPartnerUtils::ALL_PARTNERS_WILD_CHAR) {
             // all is allowed - don't add anything to the criteria
         } else {
             $criterion = null;
             if ($partnerGroup) {
                 // $partnerGroup hold a list of partners separated by ',' or $kalturaNetwork is not empty (should be mySearchUtils::KALTURA_NETWORK = 'kn')
                 $partners = explode(',', trim($partnerGroup));
                 $hasPartnerZero = false;
                 foreach ($partners as $index => &$p) {
                     trim($p);
                     // make sure there are not leading or trailing spaces
                     if ($p == 0) {
                         unset($partners[$index]);
                         $hasPartnerZero = true;
                     }
                 }
                 // add the partner_id to the partner_group
                 $partners[] = strval($partnerId);
                 $criterion = $criteria->getNewCriterion(self::PARTNER_ID, $partners, Criteria::IN);
                 if ($hasPartnerZero) {
                     $query = "(" . self::PARTNER_ID . " = 0 AND " . self::IS_DEFAULT . " = 1)";
                     $criterion->addOr($criteria->getNewCriterion(self::PARTNER_ID, $query, Criteria::CUSTOM));
                 }
             } else {
                 $criterion = $criteria->getNewCriterion(self::PARTNER_ID, $partnerId);
             }
             $criteria->addAnd($criterion);
         }
     }
     $criteriaFilter->enable();
 }
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:60,代码来源:assetParamsPeer.php


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