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); } }
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); }
public function applyCondition(IKalturaDbQuery $query) { if (is_null($this->indexIdGreaterThan)) { return; } if ($query instanceof IKalturaIndexQuery) { $query->addColumnWhere('id', $this->indexIdGreaterThan, Criteria::GREATER_THAN); } elseif ($query instanceof Criteria) { $query->add('id', $this->indexIdGreaterThan, Criteria::GREATER_THAN); } }
public function apply(baseObjectFilter $filter, IKalturaDbQuery $query) { if (!is_null($this->indexIdGreaterThan)) { $query->addColumnWhere('id', $this->indexIdGreaterThan, Criteria::GREATER_THAN); } }