I am writing an application which requires the Master/Slave switch to happen inside the application layer. As it is right now, I instantiate a Zend_Db_Table object on creati
How about something like a base class that you extend which performs the startup?
class My_Db_Table extends Zend_Db_Table
{
function init()
{
if (....) {
// set the default adaptor to the write-DB-master
}
parent::init();
}
}
// all your models then extend My_Db_Table instead of Zend_Db_Table