/** * After Saving of comments, fire an activity * * @return type */ protected function afterSave() { // flush the cache $this->flushCache(); $activity = Activity::CreateForContent($this); $activity->type = "CommentCreated"; $activity->module = "comment"; $activity->save(); $activity->fire(); // Send Notifications NewCommentNotification::fire($this); AlsoCommentedNotification::fire($this); return parent::afterSave(); }
/** * After Saving of comments, fire an activity * * @return type */ protected function afterSave() { // flush the cache $this->flushCache(); $activity = Activity::CreateForContent($this); $activity->type = "CommentCreated"; $activity->module = "comment"; $activity->save(); $activity->fire(); // Handle mentioned users // Execute before NewCommentNotification to avoid double notification when mentioned. UserMentioning::parse($this, $this->message); if ($this->isNewRecord) { // Send Notifications NewCommentNotification::fire($this); } return parent::afterSave(); }