/**
  * Creates a new ProjectActivity model.
  * If creation is successful, the browser will be redirected to the 'index' page.
  * @return mixed
  */
 public function actionCreate()
 {
     $model = new ProjectActivity();
     if ($model->load(Yii::$app->request->post()) && $model->save()) {
         Yii::info('New project activity created.', __METHOD__);
         $followers = new ProjectActivityFollowers();
         $followers->activityID = $model->activityID;
         $followers->save();
         return $this->redirect(['index']);
     } else {
         return $this->render('create', ['model' => $model]);
     }
 }
Example #2
0
 /**
  * Gets the activity followers of this activity.
  * @return mixed
  */
 public function getFollowers()
 {
     return $this->hasOne(ProjectActivityFollowers::className(), ['activityID' => 'activityID']);
 }