/** * Returns a new PageQuery object. * * @param string $modelAlias The alias of a model in the query * @param PageQuery|Criteria $criteria Optional Criteria to build the query from * * @return PageQuery */ public static function create($modelAlias = null, $criteria = null) { if ($criteria instanceof PageQuery) { return $criteria; } $query = new PageQuery(null, null, $modelAlias); if ($criteria instanceof Criteria) { $query->mergeWith($criteria); } return $query; }