我是 Php 和 Yii 的新手,你可以说我是一名新飞行员,但我正在 A380 学习飞行
问题是我在第 6 章之前一切正常 我无法理解返回到所有者和请求者下拉列表的概念
我正在并排实现它,在我的情况下,Issue.php 没有生成关系,然后我放置了以下代码
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(
'owner' => array(self::BELONGS_TO, 'User', 'owner_id'),
'project' => array(self::BELONGS_TO, 'Project', 'project_id'),
'requester' => array(self::BELONGS_TO, 'User', 'requester_id'),
);
}
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(
'issues' => array(self::HAS_MANY, 'Issue', 'project_id'),
'users' => array(self::MANY_MANY, 'User', 'tbl_project_user_assignment(project_id, user_id)'),
);
}
如果有人能解释这个我会很棒
加上为什么 self:: 使用过?
提前致谢