tag:blogger.com,1999:blog-3825636150904136311.post8358810125505833529..comments2024-02-13T15:01:56.008+01:00Comments on Symfony world: Multiple database symfony configuration (doctrine)Tomaszhttp://www.blogger.com/profile/08377176323730229843noreply@blogger.comBlogger3125tag:blogger.com,1999:blog-3825636150904136311.post-65565436917193509232011-04-21T11:14:51.929+02:002011-04-21T11:14:51.929+02:00@Charanjeet Kaur
No, it works different for me. Yo...@Charanjeet Kaur<br />No, it works different for me. You create some base classes in a custom directory, e.g.<br /><br />wp_comment (table) -> WpComment (class) for wordpress<br />or<br />ps_product (table) -> PsProduct (class) for prestashop,<br />etc.<br /><br />All those classes (WpComment, PsProduct and so on) are ABSTRACT classes. Then, for all databases that share the same structure, you create one distinct custom directory, say BlogAaa and BlogBbb (for wordpress).<br /><br />BlogAaaComment extends WpComment<br />BlogBbbComment extends WpComment<br />ShopXxxProduct extends PsProduct<br />ShopYyyProduct extends PsProduct <br />etc.<br /><br />So as you see, class names have to be different. As far as I know, symfony cache stores arrays: filepath => class-name somewhere in cache. So if you wanted to have different classes to be named the same - there'd surely be a conflict.Tomaszhttps://www.blogger.com/profile/08377176323730229843noreply@blogger.comtag:blogger.com,1999:blog-3825636150904136311.post-81429266332529322162011-04-21T09:03:35.648+02:002011-04-21T09:03:35.648+02:00does choosing own lib directory structure solves t...does choosing own lib directory structure solves the issue of same table name across database? <br />I doubt coz in config_autoload.yml.php all file names are supposed to be unique.Charanjeet Kaurhttps://www.blogger.com/profile/15427269212688655450noreply@blogger.comtag:blogger.com,1999:blog-3825636150904136311.post-55847689229500324902010-12-16T14:10:33.746+01:002010-12-16T14:10:33.746+01:00This fix works great:
http://www.funstaff.ch/2010/...This fix works great:<br />http://www.funstaff.ch/2010/08/27/multiples-connexions-doctrine-et-le-chargement-des-modelesRecelhttps://www.blogger.com/profile/03660304834352233672noreply@blogger.com