diff --git a/src/Query/Mysql/IfNull.php b/src/Query/Mysql/IfNull.php index 70dd852c..bbcdf61c 100644 --- a/src/Query/Mysql/IfNull.php +++ b/src/Query/Mysql/IfNull.php @@ -2,20 +2,28 @@ namespace DoctrineExtensions\Query\Mysql; +use Doctrine\ORM\Query\AST\ArithmeticExpression; use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; use Doctrine\ORM\Query\TokenType; /** - * "IFNULL" "(" ArithmeticExpression "," ArithmeticExpression ")" + * IfNullFunction ::= "IFNULL" "(" ArithmeticExpression "," ArithmeticExpression ")" + * + * @link https://dev.mysql.com/doc/refman/en/flow-control-functions.html#function_ifnull * * @author Andrew Mackrodt + * + * @example SELECT IFNULL(null, 2) + * @example SELECT IFNULL(foo.bar, 1) FROM entity */ class IfNull extends FunctionNode { + /** @var ArithmeticExpression */ private $expr1; + /** @var ArithmeticExpression */ private $expr2; public function parse(Parser $parser): void