for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* This file is part of Hydrogen package.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
declare(strict_types=1);
namespace RDS\Hydrogen\Fun;
use Doctrine\ORM\Query\AST\Functions\FunctionNode;
use Doctrine\ORM\Query\AST\Literal;
use Doctrine\ORM\Query\Lexer;
use Doctrine\ORM\Query\Parser;
use Doctrine\ORM\Query\SqlWalker;
* Class RawFunction
class RawFunction extends FunctionNode
{
* @var Literal
private $expr;
* @param Parser $parser
public function parse(Parser $parser): void
$parser->match(Lexer::T_IDENTIFIER);
$parser->match(Lexer::T_OPEN_PARENTHESIS);
$this->expr = $parser->StringPrimary();
$parser->match(Lexer::T_CLOSE_PARENTHESIS);
}
* @param SqlWalker $sqlWalker
* @return string
public function getSql(SqlWalker $sqlWalker): string
return $this->expr->value;