public function getDSQLExpression($expression)
    {
        if (!$this->owner->persistence || !$this->owner->persistence instanceof Persistence\SQL) {
            throw new Exception([
                'Field must have SQL persistence if it is used as part of expression',
                'persistence'=> $this->owner->persistence ?? null,
            ]);
        }

        return $this->owner->persistence->getFieldSQLExpression($this, $expression);
    }
public function getDSQLExpression($expression)
    {
        if (!$this->owner->persistence || !$this->owner->persistence instanceof Persistence\SQL) {
            throw new Exception([
                'Field must have SQL persistence if it is used as part of expression',
                'persistence'=> $this->owner->persistence ?? null,
            ]);
        }

        return $this->owner->persistence->getFieldSQLExpression($this, $expression);
    }
public function getDSQLExpression ( $ expression ) { if ( ! $ this -> owner -> persistence || ! $ this -> owner -> persistence instanceof Persistence \ SQL ) { throw new Exception ( [ 'Field must have SQL persistence if it is used as part of expression' , 'persistence' => $ this -> owner -> persistence ?? null , ] ) ; } return $ this -> owner -> persistence -> getFieldSQLExpression ( $ this , $ expression ) ; }
When field is used as expression, this method will be called.
Universal way to convert ourselves to expression. Off-load implementation into persistence.

@param Expression $expression

@return Expression
When field is used as expression this method will be called . Universal way to convert ourselves to expression . Off - load implementation into persistence .