开发者

Multiple Database in Symfony

开发者 https://www.devze.com 2023-02-01 05:46 出处:网络
What can i do for change my database conection in Symfony? I have my database.yml wi开发者_高级运维th 3 different conection and I want to change \"on fly\" of database.

What can i do for change my database conection in Symfony?

I have my database.yml wi开发者_高级运维th 3 different conection and I want to change "on fly" of database.

Thanks for your help!


You can bind tables to a specific connection - then doctrine creates them there, and whenever you use them, doctrine automatically knows which connection to use.

This example is from The symfony and Doctrine book, chapter 2:

Client:
  connection: master
  columns:
    name: string(255)
    username: string(255)
    password: string(255)
0

精彩评论

暂无评论...
验证码 换一张
取 消