public function afterSave() { // Make sure there are no multiple homepages if ($this->is_home == 1) { WikiPage::model()->contentContainer($this->content->container)->updateAll(array('is_home' => 0), 'id!=:selfId', array(':selfId' => $this->id)); } return parent::afterSave(); }
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; }
/** * 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 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); } }