for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace MartinGeorgiev\Doctrine\ORM\Query\AST\Functions;
use Doctrine\ORM\Query\Parser;
use Doctrine\ORM\Query\SqlWalker;
/**
* Implementation of PostgreSql ARRAY_AGG().
*
* @see https://www.postgresql.org/docs/17/functions-aggregate.html
* @since 1.4
* @author Martin Georgiev <[email protected]>
*/
class ArrayAgg extends BaseOrderableFunction
{
protected function customiseFunction(): void
$this->setFunctionPrototype('array_agg(%s%s)');
}
protected function parseFunction(Parser $parser): void
$this->expression = $parser->StringPrimary();
public function getSql(SqlWalker $sqlWalker): string
$dispatched = [
$this->expression->dispatch($sqlWalker),
$this->getOptionalOrderByClause($sqlWalker),
];
return \vsprintf($this->functionPrototype, $dispatched);