本文整理汇总了PHP中entryFilter::categoryIdsToSphinxIds方法的典型用法代码示例。如果您正苦于以下问题:PHP entryFilter::categoryIdsToSphinxIds方法的具体用法?PHP entryFilter::categoryIdsToSphinxIds怎么用?PHP entryFilter::categoryIdsToSphinxIds使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类entryFilter
的用法示例。
在下文中一共展示了entryFilter::categoryIdsToSphinxIds方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
}