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?
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: