本文整理汇总了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);
}
示例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);
}