Is it possible to do this in CakePHP? Can anyone give me an example how to join Comment table from db1 located on 111.111.111.111 and User table from db2 located on 222.222.222.222 where User is an owner of comment?
I'm putting my code below:
array(
'Comment' => array('joins' => array(
array(
'table' => '[222.222.222.222].[db2].[User]',
'alias' => 'UserJoin',
'type' => 'INNER',
'conditions' => array(
"AND" => array('UserJoin.user_id = Comment.user_id')
)
)
),
'order' => array('Comment.id' => 'desc'),
'fields' => array('UserJoin.*', 'Comment.*')
))