/src/Query/Mysql/Floor.php
PHP | 26 lines | 19 code | 7 blank | 0 comment | 0 complexity | ef5f9b98240d7afcd3d0d41dfbfade9c MD5 | raw file
Possible License(s): BSD-3-Clause
- <?php
- namespace DoctrineExtensions\Query\Mysql;
- use Doctrine\ORM\Query\AST\Functions\FunctionNode;
- use Doctrine\ORM\Query\Lexer;
- class Floor extends FunctionNode
- {
- private $arithmeticExpression;
- public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker)
- {
- return 'FLOOR(' . $sqlWalker->walkSimpleArithmeticExpression($this->arithmeticExpression) . ')';
- }
- public function parse(\Doctrine\ORM\Query\Parser $parser)
- {
- $parser->match(Lexer::T_IDENTIFIER);
- $parser->match(Lexer::T_OPEN_PARENTHESIS);
- $this->arithmeticExpression = $parser->SimpleArithmeticExpression();
- $parser->match(Lexer::T_CLOSE_PARENTHESIS);
- }
- }