symfony - What is the best approach to implement two bundles with common entities in Symfony2? -


i need 2 bundles share entities. best approach implement ?

i thinking creating third bundle include entities , using them within other 2 bundles, i'm not sure best approach...

thanks

i suggest introducing new bundle store common entities. let's have 2 bundles called , b have p,q,r entities in common. introduce bundle called c , place p,q,r entities there. both , b can reuse entities without problem. great feature can achieved doing is, can remove a/b bundles without affecting functionality of system. if have uni-directional/bi-directional relationships, such pointing entities p,q,r entity in a/b bundle, can't remove bundles (removing app kernal , routing). have remove relationship entities @ first place in order remove bundle. mentioned significance of relationship types when comes bundle dependency.

so, bottom line is, use bundle store common entities avoid duplication , reduce bundle dependability. recommend organising bundles according functionality of project, in independent way 1 of best approach.

hope helps,
cheers!


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -