I am trying to do the following:
- My Company models are stored in the default data source. In model, I set var $ useDbConfig = 'default';
- My "User" models are stored in another data source called 'Users_db. In this model, I set var $ useDbConfig = 'users_db';
There is an “owned” relationship between the Company and User models.
I want to make a recursive search query that returns all users for each company at a time. I have a feeling that I can’t do it with Cake, as he is now.
When I try the following:
$res2 = $this->Company->find('all', array(
'conditions' => array('Company.id' => 1),
'recursive'=>2
));
I get a message that he cannot find the users table (its search in the default source): Error: User_groups table for the model The user was not found in the datasource by default .
Can I do this?
Thanks so much for any help you can provide .....
kSeudo.
source
share