i'm trying to embed a set of EmbedDocument (points on the map) into a Document (a map), simple enough, this is my Document populated with one EmbedDocument
{ "_id" : ObjectId("54e59f081cf97091020041a9"), "title" : "test", "points" : [ { "_id" : ObjectId("54e59f081cf97091020041aa"), "description" : "bla", "lat" : 13.22, "lon" : 32.33 } ] }
fun fact the DocumentManager if asked returns the Map document with the EmbedDocument in a DBRef format and not as a Point document, so no matter if i touch/update the Map document, flushing it will lead the UnitOfWork to go nuts and throw "Warning: get_class() expects parameter 1 to be object, array given", fair enough, is that me or there's something wrong with the hydration or it must be handled my me in some nasty way?
p.s. i have a really simple metadata structure for the Documents
Map annotation:
@ODM\Document
Point annotation:
@ODM\EmbeddedDocument
Map $points ArrayCollection attribute
@ODM\EmbedMany(targetDocument="Acme\DemoBundle\Document\Point")