mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
DDC-238: PersistentCollection is not initialized when toArray() is called #297
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 @doctrinebot on GitHub (Jan 5, 2010).
Jira issue originally created by user nicokaiser:
When receiving entities from the database, collections are received as PersistentCollection objects.
A PersistentCollectionmay not be initialized (i.e. its elements are not loaded), this is done via "_initialize()" when the elements are accessed for the first time (i.e. forAll() or the corresponding "foreach" call).
However when toArray() is called, the _initialize() call is missing, so the method may return an empty array even if the collection has elements.
Shouldn't PersistentCollection::toArray() look like this?
@doctrinebot commented on GitHub (Jan 5, 2010):
@doctrinebot commented on GitHub (Jan 5, 2010):
Comment created by romanb:
Right, we got this reported two times already (this is the third) so I guess I better go fix this now ;)
@doctrinebot commented on GitHub (Jan 5, 2010):
Comment created by romanb:
Should be fixed now.
@doctrinebot commented on GitHub (Jan 5, 2010):
Issue was closed with resolution "Fixed"