You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I’ve stopped further development 3 months ago because the solution I came up with caused an update every time you persisted and there isn’t an easy fix for that due to Doctrine’s behaviour. More details can be found at doctrine/orm#617 (comment) . The solution stof suggested is to have seperate properties for that. It’s a simple fix but I didn’t like it so I put it on hold.
At the moment I always use a reference object in ORM for that ODM document. The entity in ORM just has the UUID of the document as an id and in my case a name property so you don’t have to load the ODM document if you just want to display the name. As those fields are hard-coded I didn’t create a new bundle for it. My use case are products of a webshop. Orders, categories, cart etc are all saved in ORM and only products are PHPCR ODM documents.
I’ve stopped further development 3 months ago because the solution I came up with caused an update every time you persisted and there isn’t an easy fix for that due to Doctrine’s behaviour. More details can be found at doctrine/orm#617 (comment) . The solution stof suggested is to have seperate properties for that. It’s a simple fix but I didn’t like it so I put it on hold.
At the moment I always use a reference object in ORM for that ODM document. The entity in ORM just has the UUID of the document as an id and in my case a name property so you don’t have to load the ODM document if you just want to display the name. As those fields are hard-coded I didn’t create a new bundle for it. My use case are products of a webshop. Orders, categories, cart etc are all saved in ORM and only products are PHPCR ODM documents.
You can checkout some of the code here on github:
PHPCR ODM document:
https://github.com/ecommerce/EcommerceCoreBundle/blob/master/Doctrine/Phpcr/Product.php#L304-314
ORM entity:
https://github.com/ecommerce/EcommerceCoreBundle/blob/master/Doctrine/Orm/ProductReference.php
postLoad Doctrine Phpcr Listener adding a reference (lazyloading) to the entity after loading the document:
https://github.com/ecommerce/EcommerceCoreBundle/blob/master/EventListener/DoctrinePhpcrSubscriber.php#L45-50
same for the ORM entity to have a reference to the PHPCR ODM document:
https://github.com/ecommerce/EcommerceCoreBundle/blob/master/EventListener/DoctrineOrmSubscriber.php#L42-47
If anyone needs help to implement this contact me on twitter or freenode irc in #symfony-cmf .
/cc @psren @lsmith77
The text was updated successfully, but these errors were encountered: