Ralph,

I thought of using schema. BTW, there's I believe a better way to declare a
schema:

$_name = 'myschema.tablename';

Bill Karwin mentioned somewhere that the use of $_schema is spotty and not
working properly, although I don't know which version of Zend_Db_Table was
involved when he said that.

There's one piece missing from your answer. How does the schema 'cascade' to
other tables? If I have a table Menu and a table Menu_Items where Menu is
the parent. I setup and call the Menu_Items table from Menu (I don't use
referential integrity!), but to have Menu_Items look at the same database as
Menu requires me to "pass" the schema to Menu_Items as well. That seems
hardly right, since you would need to pass the schema to every related table
as well? Or am I missing the point here?

BTW, I forgot to mention I actually use my own datamappers that call each
other, map the database relationships and use Zend_Db_Table as a gateway to
the tables themselves. However, the problem also arises when I use
Zend_Db_Table in a datamapper.

Regards, TJ.




On Mon, Dec 22, 2008 at 8:02 PM, Ralph Schindler <[email protected]>wrote:

> Taco Jung wrote:
>
>> Hi,
>>
>> I'm in the situation where I need to access tables in different databases
>> and looking for a "good" way of using Zend_Db with multiple databases.
>>
>
> Two options here:
>
> in your table definitions, you can set $_schema = 'myschema';
>
> Also, you can pass this information in at table construction time, for
> example:
>
> $table = new MyTable(array('schema' => 'myOverridingSchemaName');
>
> Does this help your situation?
>
> -ralph
>

Reply via email to