public static function create($where, $parameters = array())
{
if (is_null($where)) {
return new EmptyWhereClause();
}
if ($where instanceof WhereClause) {
return $where;
}
if (is_array($where)) {
return new ArrayWhereClause($where, 'AND');
}
if (is_string($where)) {
return new SqlWhereClause($where, $parameters);
}
throw new InvalidArgumentException("Cannot create a WhereClause for given arguments");
}