My problem is how I have to set the $condition parameter in findAll
Example
Model A DB 1
Model B DB 2
Model A belongsTo with Model B
var $belongsTo = array( 'ModelB'=>array('className' => 'ModelB',
'foreignKey' => 'ModelB_id'
)
);
Now In my controller I have
$this->ModelA->findAll('condition on an attribute of Model B')
.....
If I define this condition like: array("ModelB.attribute"=>'value');
I get an error ("Table ModelB doesn't exist")
On 25 Mar, 14:43, "Chris Hartjes" <[EMAIL PROTECTED]> wrote:
> On Tue, Mar 25, 2008 at 8:16 AM, [EMAIL PROTECTED]
>
> <[EMAIL PROTECTED]> wrote:
>
> > HI
> > I have two model in association . The problem is that these model are
> > in different database.
> > How can I use the findAll operation to make search on the foreign
> > fields of the association?
>
> If the are both on the same server but in different databases, then it
> will be no problem as long as you've setup your models properly (hint:
> $useDbConfig)
>
> http://book.cakephp.org/view/66/models
>
> --
> Chris Hartjes
> Internet Loudmouth
> Motto for 2008: "Moving from herding elephants to handling snakes..."
> @TheKeyBoard:http://www.littlehart.net/atthekeyboard
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---