You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I found out that Doctrine ArrayCollection is using a partition method which doesn't itinerate twice in the collection. So it could be very useful to have this method in this project! I can submit a PR if needed.
Describe alternatives you've considered
I am not sure if it is better to implement the method in ArrayInterface or CollectionInterface (and related abstract method of course). What do you think?
Additional context
Or maybe there is a way to do the same without modifying the project?
Thanks
Thanks for your work ;)
The text was updated successfully, but these errors were encountered:
Collections are iterable so you can already loop once and manually build 2 new collections.
I agree, a partition function (on collectioninterface imo) would make it look nicer though.
Is your feature request related to a problem? Please describe.
Yes, when I need to split a CollectionInterface in two, I have to use CollectionInterface::filter twice with opposite callbacks, which is not very efficient.
Describe the solution you'd like
I found out that Doctrine ArrayCollection is using a
partition
method which doesn't itinerate twice in the collection. So it could be very useful to have this method in this project! I can submit a PR if needed.Describe alternatives you've considered
I am not sure if it is better to implement the method in ArrayInterface or CollectionInterface (and related abstract method of course). What do you think?
Additional context
Or maybe there is a way to do the same without modifying the project?
Thanks
Thanks for your work ;)
The text was updated successfully, but these errors were encountered: