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