public function afterSave() { parent::afterSave(); if ($this->isNewRecord) { $activity = Activity::CreateForContent($this); $activity->type = "DocumentCreated"; $activity->module = "documents"; $activity->save(); $activity->fire(); } return true; }
/** * After Save Addons * * @return type */ public function afterSave() { parent::afterSave(); if ($this->isNewRecord) { $activity = Activity::CreateForContent($this); $activity->type = "QuestionCreated"; $activity->module = "questionanswer"; $activity->save(); $activity->fire(); } HSearch::getInstance()->addModel($this); return true; }
/** * 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(); }
/** * Before Save Addons * * @return type */ public function afterSave() { parent::afterSave(); if ($this->isNewRecord) { $activity = Activity::CreateForContent($this); $activity->type = "PostCreated"; $activity->module = "post"; $activity->save(); $activity->fire(); } // Handle mentioned users UserMentioning::parse($this, $this->message); return true; }
/** * After Save, delete LikeCount (Cache) for target object */ protected function afterSave() { Yii::app()->cache->delete('likes_' . $this->object_model . "_" . $this->object_id); $activity = Activity::CreateForContent($this); $activity->type = "Like"; $activity->module = "like"; // Object Id for likes are not the Like Object itself $activity->object_model = $this->object_model; $activity->object_id = $this->object_id; $activity->save(); $activity->fire(); // Send Notifications NewLikeNotification::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(); }
/** * After Saving album fire the album created activity */ public function afterSave() { parent::afterSave(); if ($this->isNewRecord) { $activity = Activity::CreateForContent($this); $activity->type = "AlbumCreated"; $activity->module = "album"; $activity->save(); $activity->fire(); /** * Fire the Notification to user followers. */ AlbumNotification::fire($this); } }