phpcr-odm
phpcr-odm copied to clipboard
[RFC] make it possible to persist serializeable objects in document
While handling with the SeoMetadata
in symfony-cmf/seo-bundle, @WouterJ and i came to the conclusion that it would be nice to do have that behavior:
https://github.com/symfony-cmf/SeoBundle/blob/master/Doctrine/Phpcr/SeoMetadataListener.php
somehow as an new field type in the phpcr-odm. This would be cool for flat value objects. Behind the scenes the phpcr-odm can serialize into an array to persist it as it is done with assoc field and back.
i think #417 would make sense. then we have about reached the limit of what makes sense - serializing and unserializing objects as a general pattern feels strange to me. you could also map them in phpcr-odm and simply add them as a child then.
I do not want a big serialization process or something equal. I see flat value objects very similar to arrays. Just to use some document metadata in a oop way. Would be nothing strange or hard.
you can map the document. or do with a listener as in SeoBundle - if we provide this in phpcr-odm we would need an interface for that and it feels to specific to me to fit into the odm.