public function toSQL(Parameters $params, bool $inner_clause)
    {
        $drv = $params->getDriver();

        $lhs = $this->getLHS() === null ? null : $drv->toSQL($params, $this->getLHS(), true);
        $rhs = $drv->toSQL($params, $this->getRHS(), true);

        $op = $this->getOperator();
        if ($lhs !== null)
        {
            $sql = $lhs . ' ' . $op . ' ' . $rhs;
            if ($inner_clause)
                return '(' . $sql . ')';
            return $sql;
        }
        
        return $op . ' ' . $rhs;
    }
public function toSQL(Parameters $params, bool $inner_clause)
    {
        $drv = $params->getDriver();

        $lhs = $this->getLHS() === null ? null : $drv->toSQL($params, $this->getLHS(), true);
        $rhs = $drv->toSQL($params, $this->getRHS(), true);

        $op = $this->getOperator();
        if ($lhs !== null)
        {
            $sql = $lhs . ' ' . $op . ' ' . $rhs;
            if ($inner_clause)
                return '(' . $sql . ')';
            return $sql;
        }
        
        return $op . ' ' . $rhs;
    }
public function toSQL ( Parameters $ params , bool $ inner_clause ) { $ drv = $ params -> getDriver ( ) ; $ lhs = $ this -> getLHS ( ) === null ? null : $ drv -> toSQL ( $ params , $ this -> getLHS ( ) , true ) ; $ rhs = $ drv -> toSQL ( $ params , $ this -> getRHS ( ) , true ) ; $ op = $ this -> getOperator ( ) ; if ( $ lhs !== null ) { $ sql = $ lhs . ' ' . $ op . ' ' . $ rhs ; if ( $ inner_clause ) return '(' . $ sql . ')' ; return $ sql ; } return $ op . ' ' . $ rhs ; }
Write an operator expression as SQL query syntax
@param Parameters $params The query parameters: tables and placeholder values
@param bool $inner_clause Whether this is a inner or outer clause. An
inner clause will be wrapped in braces when
it's a binary operator.
@return string The generated SQL
Write an operator expression as SQL query syntax