public function getDSQLExpression($expression)
    {
        $expr = $this->expr;
        if (is_callable($expr)) {
            $c = $this->expr;
            $expr = $c($this->owner, $expression);
        }

        if (is_string($expr)) {
            // If our Model has expr() method (inherited from Persistence\SQL) then use it
            if ($this->owner->hasMethod('expr')) {
                return $this->owner->expr('([])', [$this->owner->expr($expr)]);
            }

            // Otherwise call it from expression itself
            return $expression->expr('([])', [$expression->expr($expr)]);
        }

        return $expr;
    }
public function getDSQLExpression($expression)
    {
        $expr = $this->expr;
        if (is_callable($expr)) {
            $c = $this->expr;
            $expr = $c($this->owner, $expression);
        }

        if (is_string($expr)) {
            // If our Model has expr() method (inherited from Persistence\SQL) then use it
            if ($this->owner->hasMethod('expr')) {
                return $this->owner->expr('([])', [$this->owner->expr($expr)]);
            }

            // Otherwise call it from expression itself
            return $expression->expr('([])', [$expression->expr($expr)]);
        }

        return $expr;
    }
public function getDSQLExpression ( $ expression ) { $ expr = $ this -> expr ; if ( is_callable ( $ expr ) ) { $ c = $ this -> expr ; $ expr = $ c ( $ this -> owner , $ expression ) ; } if ( is_string ( $ expr ) ) { // If our Model has expr() method (inherited from Persistence\SQL) then use it if ( $ this -> owner -> hasMethod ( 'expr' ) ) { return $ this -> owner -> expr ( '([])' , [ $ this -> owner -> expr ( $ expr ) ] ) ; } // Otherwise call it from expression itself return $ expression -> expr ( '([])' , [ $ expression -> expr ( $ expr ) ] ) ; } return $ expr ; }
When field is used as expression, this method will be called.

@param \atk4\dsql\Expression $expression

@return \atk4\dsql\Expression
When field is used as expression this method will be called .