public function relations()
{
return array(
'idAuthor' => array(self::BELONGS_TO, 'User', 'id'),
);
}
public function relations()
{
return array(
'articles' => array(self::HAS_MANY, 'Article', 'id_author'),
);
}
$post= Article::model()->findByPk(1);
echo $post->title;
echo $post->login;
таблица1 Article: title, content, id_author. таблица2 User: id, login.
в чем ошибка? Property "Article.login" is not defined. как иправить?