Grant Cox wrote:
> Except that your original post suggested that you wanted to use the
> "User.id" as a condition in your WHERE clause, for a join between
> Users and Documents.  Which is simply not possible when you have two
> databases with different permissions, regardless of the framework (or
> lack thereof) - it just isn't possible in SQL.

I know it isnt possible in SQL, but im asking about cake, its possible that a 
framework sitting above the raw sql can manage at least some subset of these 
types of queries.

> When you have to have different connections to the database, then you
> will need to use multiple queries - so the only way to do it is
> $users = $this->User->findAll( $user_conditions, array('User.id') );
> $user_ids = Set::extract($users, '{n}.User.id');
> $documents = $this->Document->findAll( array('Document.user_id'=>
> $user_ids) );
> 
> which really isn't that complex.

For me complexity isnt really the issue, although any change from a plain 
findAll($conditions) introduces some complexity.

really my concerns are portability of the model and possible issues when 
working 
on a team. where do you push this knowledge of seperate db configs?
what happens with plugins and components?

thanks for your thoughts..

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