Example #1
0
 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();
 }
Example #2
0
 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;
 }
Example #4
0
 /**
  * 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;
 }
Example #5
0
 /**
  * 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);
     }
 }