http://stackoverflow.com/questions/432086/zend-framework-with-multiple-schema-databases
http://stackoverflow.com/questions/432086/zend-framework-with-multiple-schema-databases
I have a few tables that I've defined like the below examples:
class TableA extends Zend_Db_Table_Abstract
{
protected $_schema = 'schema1';
protected $_name = 'tablea';
}
class TableB extends Zend_Db_Table_Abstract
{
protected $_schema = 'schema2';
protected $_name = 'tableb';
}
This seems to work perfectly using one default Db adapter (since the 2
schemas are on the same server).
Code like this works:
$tableA = new TableA();
$select = $tableA->select();
// $select->__toString() outputs: SELECT * FROM `schema1`.`tablea`
However, when I try to use the same models with any of the Zend Framework
table relationship functions (ie: findDependantRowset() or
findManyToManyRowset()) the query tries to execute using the schema from the
default adapter and does not use the appropriate schema that is defined in
the model class.
Is this a bug? How can I force ZF to use the schema I have defined in the
table class and not the one defined as the default in the default Db
adapter?
--
View this message in context: http://www.nabble.com/Problems-with-findManyToManyRowset%28%29-tp21395971p21395971.html
Sent from the Zend DB mailing list archive at Nabble.com.
没有评论:
发表评论