phpro / zf-doctrine-hydration-module

Configurable Doctrine hydrators for ZF2
18 stars 33 forks source link

Embedded doc data not saved #5

Closed MassiAtZend closed 9 years ago

MassiAtZend commented 10 years ago

Hi veewee, sorry to bother again. I cannot get my head around the hydration of 'embedded docs' working with 'zf-apigility-doctrine'.

I have have a MappedSuperclass holding an EmbedDocument as per below code: /**

... getters and setters }

The embedded doc is defined like this:

/**

The concrete child is a very simple doc with 2 params as follow: /**

From POSTMAN I send the following POST data to create a 'singlesku' document: { "brand": "The Brand", "proddesc": "Just a description!!!", "quantity": 4, "warranty": 5, "isUnique": true, "googleGtin": "GTin from Google", "physicalAttributes": { "width": 12.5, "depth": 13.52, "height": 28.654, "weight": 543.97 } }

The 'singlesku' document is successfully created in Mongo yet with no embedded 'PhysicalAttributes' data.

The JSON returned by Apigility is the following: { _isUnique: true googleGtin: "GTin from Google" id: "53c7887f05e17e65840041a8" brand: "The Brand" proddesc: "Just a description!!!" quantity: 4 warranty: 5 -_physicalAttributes: { width: 12.5 depth: 13.52 height: 28.654 weight: 543.97 } -_links: { -self: { href: "http:\/\/localhost:8888\/api\/singlesku\/53c7887f05e17e65840041a8" } } }

Any help appreciated, as usual.

veewee commented 9 years ago

@MassiAtZend Is this still an issue? It looks like it's an issue with Dotrine ODM MongoDB which wil probably be fixed by now?