views:

1244

answers:

2

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?

A: 

I think you can use a database view table to merge data from 2 schemas, and then use Zend Framework to fetch data from that table.

farzad
You think that is easier than ZF respecting my $_schema input?
leek
+1  A: 

I think this is related to this bug: http://framework.zend.com/issues/browse/ZF-1838

It has been fixed in the upstream and should be available in the next release.

stunti
Thanks. If it is fixed in 1.7.3 I will close this as no longer relevent.
leek