public function toSql() { $sql = DialectFactory::create()->buildQuery($this->query); return $this->negate ? "NOT EXISTS ({$sql})" : "EXISTS ({$sql})"; }