mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
DDC-1116: Sort by association id #1396
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @doctrinebot on GitHub (Apr 15, 2011).
Originally assigned to: @guilhermeblanco on GitHub.
Jira issue originally created by user rande:
For now it is not possible to sort a result by an association field.
ie : SELECT * FROM Post as p ORDER BY p.Author
@doctrinebot commented on GitHub (Jun 3, 2011):
Comment created by justhannes:
I agree, maybe even make it sortable by a field of the target?
ie: SELECT * FROM Post as p ORDER BY p.Author.Name
@doctrinebot commented on GitHub (Jul 8, 2011):
Comment created by guillaumec@gmail.com:
I agree with Johannes about sorting by a field of the target.
Without this feature or a decent workaround, I will have to stop using doctrine for my project.
@doctrinebot commented on GitHub (Jul 8, 2011):
Comment created by @guilhermeblanco:
Hi,
I think the first one if doable.
But please take in mind that it's doable if your association is the owning side and is a *ToOne side. I say that because it could generate a SQL like this:
If it's a *ToMany, it's impossible. No way to achieve it.
But if it's the inverse side, it is doable, but it would require a JOIN. We dropped this "auto inclusion" of JOINs back in RC3 because it is not stable and to make it stable would make the overall Parser performance much slow. The other reason is that developer is pretty able to do the join yourself. I'll take the first comment as an example:
This one is already supported. =)
Cheers,
@doctrinebot commented on GitHub (Jul 8, 2011):
Comment created by guillaumec@gmail.com:
Thank you Guilherme Blanco, this fixes the issue for me!
@doctrinebot commented on GitHub (Aug 14, 2011):
Comment created by @guilhermeblanco:
Added support to SingleValuedPathExpression in ORDER BY since this commit:
a0ca506db7Thanks for the report.
Cheers,
@doctrinebot commented on GitHub (Aug 14, 2011):
Issue was closed with resolution "Fixed"