Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Query\Parser: support for functions in ORDER BY clause #692

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
3 participants
Contributor

Slamdunk commented Jun 12, 2013

No description provided.

Owner

Ocramius commented Jun 12, 2013

@Slamdunk IIRC this was not implemented because it's not supported by all vendors.

Contributor

Slamdunk commented Jun 12, 2013

I think if your vendor doesn't support it, you simply don't use functions, do you?

Owner

Ocramius commented Jun 12, 2013

@Slamdunk no, that's not portable, which means it cannot stay in core

@Slamdunk Slamdunk closed this Jun 12, 2013

@Slamdunk Slamdunk deleted the Slamdunk:orderby-function branch Jun 12, 2013

Member

stof commented Jun 12, 2013

@Slamdunk DQL is an abstraction. So we cannot add it if it requires knowing which platform you use.

Thus, it is already possible to order by fields which are not part of the result set thanks to the HIDDEN keyword:

SELECT u, CONCAT(u.firstName, u.lastName) as HIDDEN full_name
FROM Entity\User u
ORDER BY full_name
Contributor

Slamdunk commented Jun 13, 2013

Tnx @stof I've reached the solution you described after some googling.

I think we'd better PR this note on the official documentation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment