mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
[PR #1576] Chained selectable matching #9631
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?
Original Pull Request: https://github.com/doctrine/orm/pull/1576
State: closed
Merged: No
The purpose is to make it possible to do selectable matching keeping the _lazy behavior_, aggregating the criterias until the collection is initialized(used)
The current behavior get the results as soon as you call the matching, and it forces us to build the full criteria before calling matching, however, if this change is approved it will do the query only when the selectable is in fact used (any other method)
PS: I ended up in this solution because the second call to matching (which should filter it on ArrayCollection) was giving me a collection with results I didn't expect to see, and that probably means that there is some sort of issue with ArrayCollection matching, but maybe I am missing something.
I also would like some advice in the
$this->any()on the tests. I did it to make sure that the cloned mock will receive the same value provided in the original one, but I couldn't use$this->once(), because it would fail in the original mock.