Details
-
Type:
Improvement
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Won't Fix
-
Affects Version/s: 1.0.0ALPHA1
-
Fix Version/s: None
-
Component/s: Hydration
-
Labels:None
Description
Currently ODM creates an instance of ArrayCollection for every referenced/embedded collection.
It would be great, if there was a way to specify which collection class should be actually used. Imagine simple use-case: one have created class TagsCollection extends ArrayCollection with __toString method, which automatically transforms collection of tags to comma-separated tags string.
Would it be possible to have e.g. @EmbedMany(collection="TagsCollection") ?
Is it not just as simple for you to do this yourself instead of cluttering the Doctrine codebase? Simply wrap your collection with your own class. Use another class to do what you want, passing the collection to it.