/** * @return SelectQuery **/ protected function makeSelectQuery() { if ($this->criteria) { return $this->criteria->toSelectQuery(); } return $this->container->getDao()->makeSelectHead(); }
/** * @throws WrongArgumentException * @return SelectQuery **/ public static function makeFullTextQuery(FullTextDAO $dao, Criteria $criteria, $string) { Assert::isString($string, 'only strings accepted today'); $array = self::prepareSearchString($string); if (!$array) { throw new ObjectNotFoundException(); } if (!($field = $dao->getIndexField()) instanceof DBField) { $field = new DBField($dao->getIndexField(), $dao->getTable()); } return $criteria->toSelectQuery()->andWhere(Expression::fullTextOr($field, $array))->prependOrderBy(Expression::fullTextRankAnd($field, $array))->desc(); }
public static function utilizeCriteria(Criteria $criteria) { return new self($criteria->getDao(), $criteria->toSelectQuery()); }