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


PHP entryPeer::s_criteria_filter方法代码示例

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


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

示例1: setDefaultCriteriaFilter

 public static function setDefaultCriteriaFilter()
 {
     if (self::$s_criteria_filter == null) {
         self::$s_criteria_filter = new criteriaFilter();
     }
     $c = KalturaCriteria::create(entryPeer::OM_CLASS);
     $c->addAnd(entryPeer::STATUS, entryStatus::DELETED, Criteria::NOT_EQUAL);
     $critEntitled = null;
     $ks = ks::fromSecureString(kCurrentContext::$ks);
     //when entitlement is enable and admin session or user session with list:* privilege
     if (kEntitlementUtils::getEntitlementEnforcement() && (kCurrentContext::$is_admin_session || !self::$userContentOnly)) {
         $privacyContexts = kEntitlementUtils::getPrivacyContextSearch();
         $critEntitled = $c->getNewCriterion(self::PRIVACY_BY_CONTEXTS, $privacyContexts, KalturaCriteria::IN_LIKE);
         $critEntitled->addTag(KalturaCriterion::TAG_ENTITLEMENT_ENTRY);
         if (kCurrentContext::getCurrentKsKuserId()) {
             //ENTITLED_KUSERS field includes $this->entitledUserEdit, $this->entitledUserEdit, and users on work groups categories.
             $entitledKuserByPrivacyContext = kEntitlementUtils::getEntitledKuserByPrivacyContext();
             $critEntitledKusers = $c->getNewCriterion(self::ENTITLED_KUSERS, $entitledKuserByPrivacyContext, KalturaCriteria::IN_LIKE);
             $critEntitledKusers->addTag(KalturaCriterion::TAG_ENTITLEMENT_ENTRY);
             $categoriesIds = array();
             $categoriesIds = categoryPeer::retrieveEntitledAndNonIndexedByKuser(kCurrentContext::getCurrentKsKuserId(), kConf::get('category_search_limit'));
             if (count($categoriesIds) >= kConf::get('category_search_limit')) {
                 self::$kuserBlongToMoreThanMaxCategoriesForSearch = true;
             }
             if (count($categoriesIds)) {
                 $critCategories = $c->getNewCriterion(self::CATEGORIES_IDS, $categoriesIds, KalturaCriteria::IN_LIKE);
                 $critCategories->addTag(KalturaCriterion::TAG_ENTITLEMENT_ENTRY);
                 $critEntitled->addOr($critCategories);
             }
             $critEntitled->addOr($critEntitledKusers);
         }
         //user should be able to get all entries s\he uploaded - outside the privacy context
         $kuser = kCurrentContext::getCurrentKsKuserId();
         if ($kuser !== 0) {
             $critKuser = $c->getNewCriterion(entryPeer::KUSER_ID, $kuser, Criteria::EQUAL);
             $critKuser->addTag(KalturaCriterion::TAG_ENTITLEMENT_ENTRY);
             $critEntitled->addOr($critKuser);
         }
     } elseif (self::$userContentOnly) {
         $critEntitled = $c->getNewCriterion(entryPeer::KUSER_ID, kCurrentContext::getCurrentKsKuserId(), Criteria::EQUAL);
         $critEntitled->addTag(KalturaCriterion::TAG_WIDGET_SESSION);
     }
     if ($ks && count($ks->getDisableEntitlementForEntry())) {
         $entryCrit = $c->getNewCriterion(entryPeer::ENTRY_ID, $ks->getDisableEntitlementForEntry(), Criteria::IN);
         $entryCrit->addTag(KalturaCriterion::TAG_ENTITLEMENT_ENTRY);
         if ($critEntitled) {
             $critEntitled->addOr($entryCrit);
         } else {
             $critEntitled = $entryCrit;
         }
     }
     if ($critEntitled) {
         $c->addAnd($critEntitled);
     }
     self::$s_criteria_filter->setFilter($c);
 }
开发者ID:DBezemer,项目名称:server,代码行数:56,代码来源:entryPeer.php

示例2: setDefaultCriteriaFilter

 public static function setDefaultCriteriaFilter()
 {
     if (self::$s_criteria_filter == null) {
         self::$s_criteria_filter = new criteriaFilter();
     }
     $c = new myCriteria();
     $c->addAnd(entryPeer::STATUS, entryStatus::DELETED, Criteria::NOT_EQUAL);
     self::$s_criteria_filter->setFilter($c);
 }
开发者ID:richhl,项目名称:kalturaCE,代码行数:9,代码来源:entryPeer.php


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