i have two tables in my webapplication one for authentication and other for information of user. and thier relative models are User_authen and User_suthen_info it looks like this… i have innodb as mysql engin
class User_authen extends CActiveRecord
{
...
public function relations()
{
// NOTE: you may need to adjust the relation name and the related
// class name for the relations automatically generated below.
return array(
'userAuthenInfo' => array(self::HAS_ONE, 'UserAuthenInfo', 'user_authen_id'),
);
}
...
}
class User_authen_info extends CActiveRecord
{
...
public function relations()
{
// NOTE: you may need to adjust the relation name and the related
// class name for the relations automatically generated below.
return array(
'userAuthen' => array(self::BELONGS_TO, 'UserAuthen', 'user_authen_id'),
);
}
...
}
My query
$post=User_authen_info::model()->findByPk(151);
$author=$post->userAuthen;
var_dump($author);
exit;
now when i var_dump to see what is the response it says
include(UserAuthen.php): failed to open stream: No such file or directory
i cant figure it out what is the problem… i am new to yii so don’t know how relations works… i have visited here
but i am unable to figure it out what is problem…
help me guys…