protected function buildSubquery(callable $f)
    {
        $query = new SelectQuery();
        $query->getSelect()->clearFields();
        $f($query);
        $sql = $query->build();
        $this->values = array_merge($this->values, $query->getValues());

        return '('.$sql.')';
    }
protected function buildSubquery(callable $f)
    {
        $query = new SelectQuery();
        $query->getSelect()->clearFields();
        $f($query);
        $sql = $query->build();
        $this->values = array_merge($this->values, $query->getValues());

        return '('.$sql.')';
    }
protected function buildSubquery ( callable $ f ) { $ query = new SelectQuery ( ) ; $ query -> getSelect ( ) -> clearFields ( ) ; $ f ( $ query ) ; $ sql = $ query -> build ( ) ; $ this -> values = array_merge ( $ this -> values , $ query -> getValues ( ) ) ; return '(' . $ sql . ')' ; }
Builds a subquery.

@param callable $f

@return string
Builds a subquery .