I have a similar question to this one :

http://groups.google.com/group/cake-php/browse_thread/thread/739fceb74b7ad621/f79ef013c80afccf?lnk=gst

which is kind of lurking unanswered. :)

Say I have 2 models, User and Document

User hasMany Documents
Document belongsTo User

They each live in seperate databases, so in the User model i have

var $useDbConfig = 'users';

while the Document uses the default dbConfig.

Both db config's have persistent set to false.

What I would like to do is to query the Document model using conditions on the 
User model, e.g.

$this->Document->recursive = 1;
$this->Document->findAll(array('User.id'=>'1'));

but I get the error: Unknown column 'User.id' in 'where clause'

which is because the User lives in the other DB.

So, is this supposed to work? or is it a situation i have to deal with manually?

i.e. query one model, loop over the results to provide conditions for querying 
the second model

or is there some other kind of cake magic I can use?

thanks,

Martin

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to