Custom Collection in Doctrine2

Thouttyannoxy

New Member
Just starting to work with Doctrine2, and am wondering how/if I can use a custom collection class. Searches point me to this part of the documentation:\[quote\] Collection-valued persistent fields and properties must be defined in terms of the \[code\]Doctrine\Common\Collections\Collection\[/code\] interface. The collection implementation type may be used by the application to initialize fields or properties before the entity is made persistent. Once the entity becomes managed (or detached), subsequent access must be through the interface type.\[/quote\]While I'm sure that's crystal clear to someone, I'm a little fuzzy on it. If I setup my Entity to initialize (say in \[code\]__construct()\[/code\]) the collection variable to a class that implements the correct interface - will Doctrine2 continue to use that class as the collection? Am I understanding that correctly?Update: Also, I gather from various threads that the placeholder object used in lazy loading may influence how a custom collection can be used.
 
Back
Top