Skip to content


DDC-216: PersistentCollection#toArray() should call _initialize() #2850

doctrinebot opened this Issue · 3 comments

1 participant


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.


Comment created by romanb:

Should be fixed now.


Issue was closed with resolution "Fixed"

@doctrinebot doctrinebot added this to the 2.0-ALPHA4 milestone
@doctrinebot doctrinebot closed this
@doctrinebot doctrinebot added the Bug label
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.