function __construct($type) { $type = strtolower($type); if ($type !== 'or' && $type !== 'and') { DB::nonSQLError('you must use either WhereClause(and) or WhereClause(or)'); } $this->type = $type; }
function __construct($type, $mdb = null) { $type = strtolower($type); if ($type != 'or' && $type != 'and') { DB::nonSQLError('you must use either WhereClause(and) or WhereClause(or)'); } $this->type = $type; if ($mdb === null) { $this->mdb = DB::getMDB(); } else { if ($mdb instanceof MeekroDB) { $this->mdb = $mdb; } else { DB::nonSQLError('the second argument to new WhereClause() must be an instance of class MeekroDB'); } } }