3

The application was initially using single database, but now I am changing it so different groups of data sits in different database. I added the other database using multidb. Now some model's are using non-default database, but I don't know how to force a model to use specific adapter all the time. I tried changing the adapter by using Zend_Db_Table::setDefaultAdapter before interacting with models, but now I have to change all function of all models, to make sure the model is interacting with the right adapter. Is there any simpler way of achieving them. My model's extend Zend_Db_table.

Bryan
  • 645
  • 1
  • 6
  • 18

1 Answers1

4

This should help you out: http://jameshd.wordpress.com/2010/09/27/zend-multi-db/

With some basic extensions and a per-model setting of what database adapter to use, you should be good to go.

Darryl E. Clarke
  • 7,537
  • 3
  • 26
  • 34