mardi 21 juillet 2015

How to properly detach Symfony Bundles (pattern)

I would like to develop a CMS with ecommerce solution on Symfony 2 and Doctrine. I would like to have a Core Bundle for CMS and some other Bundles I could add based on what clients expects.

My question is how to detach Bundles? I mean there are some relations between Shop Bundles and Core Bundles. If I add them in doctrine.orm.yml files with owning side in Shop Bundle and inverse side in Core bundle, then in situation when client wants only CMS (Core Bundle) I don't want to put there Shop Bundle too. If I won't do it, then there will be an error, that Core Bundle has some foreign keys to Table that doesn't exists.

So how to handle it? Maybe database should be designed in a way that nothing from Core Bundle has connection with Shop Bundles? Only vice versa? Or there is a way of doing it with interfaces or sth else? Any ideas?

Aucun commentaire:

Enregistrer un commentaire