mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
DDC-216: PersistentCollection#toArray() should call _initialize() #270
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 (Dec 17, 2009).
Jira issue originally created by user itoijala:
Calling toArray on a PersistentCollection does not initialize the collection. This means that a not yet initialized collection returns an empty array. This is not expected behavior. The user expects the collection to be initialized and the objects returned. Calling count first is a workaround to initialize the array because count calls _initialize.
A use case is an accessor wanting to return an array to not expose the collection to modification.
@doctrinebot commented on GitHub (Dec 17, 2009):
@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"