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

Closed
doctrinebot opened this Issue Dec 17, 2009 · 3 comments

1 participant

@doctrinebot

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

Comment created by romanb:

Should be fixed now.

@doctrinebot

Issue was closed with resolution "Fixed"

@doctrinebot doctrinebot added this to the 2.0-ALPHA4 milestone Dec 6, 2015
@doctrinebot doctrinebot closed this Dec 6, 2015
@doctrinebot doctrinebot added the Bug label Dec 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment