cakephp association error?
Warning (512): Model "User" is not associated with model "User" [CORE\cake\libs\model\behaviors\containable.php, line 340]
im getting this error when accessing datas of photo, friend user has many photos and friend, photos and friend belongs to user
in photos index page, two warnings one for user mentioned above and other for 'Friend' as same friend is not associated with model 'friend'
what to do? what 开发者_JAVA技巧to check?
You have some mismatch with assotiations.
You can have situation similar to this:
User habtm array("Friend"=> array("className"=>"User")
And when finding users:
$this->User->find("all", array(
"contain"=>array("User");
));
instead of:
$this->User->find("all", array(
"contain"=>array("Friend");
));
Check this or post some code :)
精彩评论