/**
  * Override to handle sending email messages on new comment
  */
 protected function afterSuccessfulSave($model)
 {
     assert('$model instanceof Item');
     parent::afterSuccessfulSave($model);
     $user = Yii::app()->user->userModel;
     if ($this->relatedModel instanceof Conversation) {
         $participants = ConversationsUtil::resolvePeopleToSendNotificationToOnNewComment($this->relatedModel, $user);
         CommentsUtil::sendNotificationOnNewComment($this->relatedModel, $model, $user, $participants);
     } elseif ($this->relatedModel instanceof Mission) {
         $participants = MissionsUtil::resolvePeopleToSendNotificationToOnNewComment($this->relatedModel, $user);
         CommentsUtil::sendNotificationOnNewComment($this->relatedModel, $model, $user, $participants);
     }
 }
 /**
  * Override to handle sending email messages on new comment
  */
 protected function afterSuccessfulSave($model)
 {
     assert('$model instanceof Item');
     parent::afterSuccessfulSave($model);
     $user = Yii::app()->user->userModel;
     if ($this->relatedModel instanceof Conversation) {
         $participants = ConversationsUtil::resolvePeopleToSendNotificationToOnNewComment($this->relatedModel, $user);
         CommentsUtil::sendNotificationOnNewComment($this->relatedModel, $model, $participants);
     } elseif ($this->relatedModel instanceof Mission) {
         $participants = MissionsUtil::resolvePeopleToSendNotificationToOnNewComment($this->relatedModel, $user);
         CommentsUtil::sendNotificationOnNewComment($this->relatedModel, $model, $participants);
     } elseif ($this->relatedModel instanceof Task) {
         TasksNotificationUtil::submitTaskNotificationMessage($this->relatedModel, TasksNotificationUtil::TASK_NEW_COMMENT, $model->createdByUser, $model);
         //Log the event
         if ($this->relatedModel->project->id > 0) {
             ProjectsUtil::logAddCommentEvent($this->relatedModel, $model->description);
         }
     }
 }