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
Hello,
so here is issue in doctrine with LazyCollections doctrine/orm#8739 (comment)
Long story short if collection is lazy and we call remove() ideally we don't want to load whole collection into memory.
This can be implemented but there is issue with return type of remove(). When calling it on lazy collection we don't know if element is within collection or not. Therefore cannot return bool true/false.
So ideally I'd change Collection::removeElement : bool to Collection::removeElement : bool|null with description that null is returned if removal cannot be confirmed (eg. lazy collection)
Does that make sense?
The text was updated successfully, but these errors were encountered:
I don't think I want to widen the return type for this. Would it be a problem if your lazy implementation would always return true as long as it hasn't been initialized?
Sorry got consumed in other stuff but I see issue is still open.
Returning always true can be misleading. And a silent BC break so I'm not sure if that would be good idea.
If lazy collection returns true this condition suddenly changes behaviour. Probably normally a contains() will be called beforehead but you cannot be sure.
I guess eventuallyRemove or LazyRemove to LazyCollection could be way to go.
Hello,
so here is issue in doctrine with LazyCollections doctrine/orm#8739 (comment)
Long story short if collection is lazy and we call remove() ideally we don't want to load whole collection into memory.
This can be implemented but there is issue with return type of remove(). When calling it on lazy collection we don't know if element is within collection or not. Therefore cannot return bool true/false.
So ideally I'd change
Collection::removeElement : bool
toCollection::removeElement : bool|null
with description that null is returned if removal cannot be confirmed (eg. lazy collection)Does that make sense?
The text was updated successfully, but these errors were encountered: