dataClass); $this->query = $base->query; $this->whereQuery = new SQLSelect(); $this->whereQuery->setConnective($connective); $base->where($this); } public function where($filter) { if ($filter) { $this->whereQuery->addWhere($filter); } return $this; } public function whereAny($filter) { if ($filter) { $this->whereQuery->addWhereAny($filter); } return $this; } public function conditionSQL(&$parameters) { $parameters = []; // Ignore empty conditions $where = $this->whereQuery->getWhere(); if (empty($where)) { return null; } // Allow database to manage joining of conditions $sql = DB::get_conn()->getQueryBuilder()->buildWhereFragment($this->whereQuery, $parameters); return preg_replace('/^\s*WHERE\s*/i', '', $sql ?? ''); } }