mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
PersistentCollection ignore orderBy on matching($criteria) #5584
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 @sven-communitales on GitHub (Jun 22, 2017).
doctrine/orm: 2.5.6
The PersistentCollection::matching() method does not take the ordering of a Criteria in account. For an ArrayCollection is works fine.
Reproduce:
I have two Entities
And I have a method to get the filterAttributes as an ordered List in the Product Entity:
The Product Entity is loaded from the Database. So the Collection is a PersistentCollection with a ManyToManyPersister.
Expected Behavior: The returned list is ordered by the position field.
Current Behavior: The returned list is unordered.
Current Workaround:
@lcobucci commented on GitHub (Jun 23, 2017):
@sven-communitales could you please send us a PR with a functional test that reproduces this behaviour? Sending just an example doesn't give us the complete overview of things and why it fails. You can find examples on
971c400025/tests/Doctrine/Tests/ORM/Functional