symfony-cmf / media-bundle

UNMAINTAINED - Minimalistic interfaces to handle media in the context of the CMF
http://cmf.symfony.com/
30 stars 40 forks source link

Attach image to orm Entity? #122

Closed Clindbergh closed 9 years ago

Clindbergh commented 9 years ago

This is probably rather a general question about phpcr, but the usecase is within this bundle, so I'm posting it here.

Is it possible to attach an Image (managed by doctrinephpcr-odm) to an entity managed by doctrine-orm?

If yes, how would this be configured? Is it possible to do the opposite (add a orm-entity to a phpcr-odm managed page)?

gonzalovilaseca commented 9 years ago

I'm currently working on this for symfony. Right now you can use the Gedmo 'References' extension. Problem is that there is no cascade persist or remove, and that's something I'm also working right now, will do a PR to Gedmo repo as soon as it's finished.

dbu commented 9 years ago

a couple of people have started efforts for a orm-odm adapter, for example https://github.com/ElectricMaxxx/DoctrineOrmOdmAdapter by @ElectricMaxxx. but to my knowledge, none of the systems are production ready.

gonzalovilaseca commented 9 years ago

I've abandoned the idea, too complicated. What I'm doing is store the odm id in a orm string field, then use a data transformer for the form.

dbu commented 9 years ago

cool if that works. do you profit from the image being in phpcr-odm? otherwise you maybe could also just store the image in the filesystem (outside the webroot probably) - whatever makes more sense for you.

ok if we close this issue here?