Specifying a value in the select clause, such as the following, causes a parser error:
queryBuilder->select('p.name as name, \'foo\' as bar')
The equivalent SQL would be:
SELECT p.name as name, 'foo' as bar FROM person;
And would result in something like the following:
The error output:
Doctrine\ORM\Query\QueryException : [Syntax Error] line 0, col 136: Error:
Expected IdentificationVariable | StateFieldPathExpression | AggregateExpression | "(" Subselect ")" | ScalarExpression, got 'foo'