phpcr-odm icon indicating copy to clipboard operation
phpcr-odm copied to clipboard

[RFC] make it possible to persist serializeable objects in document

Open ElectricMaxxx opened this issue 10 years ago • 3 comments

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.

ElectricMaxxx avatar Mar 31 '14 10:03 ElectricMaxxx

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.

dbu avatar Mar 31 '14 11:03 dbu

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.

ElectricMaxxx avatar Mar 31 '14 11:03 ElectricMaxxx

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.

dbu avatar Mar 31 '14 19:03 dbu