本文整理汇总了PHP中entryFilter::categoryFullNamesToIdsParsed方法的典型用法代码示例。如果您正苦于以下问题:PHP entryFilter::categoryFullNamesToIdsParsed方法的具体用法?PHP entryFilter::categoryFullNamesToIdsParsed怎么用?PHP entryFilter::categoryFullNamesToIdsParsed使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类entryFilter
的用法示例。
在下文中一共展示了entryFilter::categoryFullNamesToIdsParsed方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: applyCondition
public function applyCondition(IKalturaDbQuery $query)
{
if (is_null($this->categoriesMatchOr) && is_null($this->categoryIdEqual)) {
return;
}
// Fetch the list of categories
$categoryEntries = null;
if ($this->categoriesMatchOr) {
$categoryEntries = entryFilter::categoryFullNamesToIdsParsed($this->categoriesMatchOr, $this->categoryEntryStatusIn);
} else {
$categoryEntries = entryFilter::categoryIdsToSphinxIds($this->categoryIdEqual, $this->categoryEntryStatusIn);
}
if ($categoryEntries == '') {
// Set a non-exiting cat. id. in order to return empty results (instead of throwing an exception)
$categoryEntries = category::CATEGORY_ID_THAT_DOES_NOT_EXIST;
}
$categoryEntries = explode(',', $categoryEntries);
$query->addColumnWhere(entryPeer::CATEGORIES_IDS, $categoryEntries, KalturaCriteria::IN_LIKE);
if ($this->orderBy) {
$orderByField = substr($this->orderBy, 1);
$orderBy = $this->orderBy[0] == '+' ? Criteria::ASC : Criteria::DESC;
if ($orderByField != self::CREATED_AT) {
throw new kCoreException("Unsupported orderBy criteria [{$orderByField}]");
}
$dynAttribCriteriaFieldName = entryIndex::DYNAMIC_ATTRIBUTES . '.' . self::getCategoryCreatedAtDynamicAttributeName($this->categoryIdEqual);
$query->addNumericOrderBy($dynAttribCriteriaFieldName, $orderBy);
}
}
示例2: apply
public function apply(baseObjectFilter $filter, IKalturaDbQuery $query)
{
if (is_null($this->categoriesMatchOr) || is_null($this->categoryEntryStatusIn)) {
return;
}
$categoriesTocategoryEntryStatus = entryFilter::categoryFullNamesToIdsParsed($this->categoriesMatchOr, $this->categoryEntryStatusIn);
if ($categoriesTocategoryEntryStatus == '') {
$categoriesTocategoryEntryStatus = category::CATEGORY_ID_THAT_DOES_NOT_EXIST;
}
$query->addColumnWhere(entryPeer::CATEGORIES_IDS, explode(',', $categoriesTocategoryEntryStatus), kalturaCriteria::IN_LIKE);
}
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:11,代码来源:kCategoryEntryAdvancedFilter.php