TimKan 2012-09-13 15:48:07 2933次浏览 1条回复 0 0 0
Hi,
first of all thanx for providing this book Agile.Web.Application.Development.with.Yii1.1.and.PHP5.

And here's my question:
When I add a new project no relation is added in the tbl_project_user_assignment. When I then want to add an issue to this project, it will not work, since no owner or requester can be found.
So how can I manage that the relation between a logged in user and a project he creates is automatically saved in the tbl_project_user_assignment table?
  • 回复于 2012-09-13 16:18 举报
    after the project::save(), assign the user id to tbl_project_user_assignment.user_id :
    $tmp=new Project();
    $tmp->user_id=Yii::app()->user->id;
    $tmp->other fields
    $tmp->save();
    
您需要登录后才可以回复。登录 | 立即注册