/**
  * Saves subscription state.
  */
 public function saveSubscription()
 {
     // subscribe
     if ($this->parameters['subscribe']) {
         // newly subscribed
         if ($this->userObjectWatch === null) {
             UserObjectWatchEditor::create(array('notification' => $this->parameters['enableNotification'] ? 1 : 0, 'objectID' => $this->parameters['objectID'], 'objectTypeID' => $this->objectType->objectTypeID, 'userID' => WCF::getUser()->userID));
         } else {
             if ($this->userObjectWatch->notification != $this->parameters['enableNotification']) {
                 // update notification type
                 $editor = new UserObjectWatchEditor($this->userObjectWatch);
                 $editor->update(array('notification' => $this->parameters['enableNotification'] ? 1 : 0));
             }
         }
         // reset user storage
         $this->objectType->getProcessor()->resetUserStorage(array(WCF::getUser()->userID));
     } else {
         if ($this->userObjectWatch !== null) {
             // unsubscribe
             $editor = new UserObjectWatchEditor($this->userObjectWatch);
             $editor->delete();
             // reset user storage
             $this->objectType->getProcessor()->resetUserStorage(array(WCF::getUser()->userID));
         }
     }
     return array('objectID' => $this->parameters['objectID'], 'subscribe' => $this->parameters['subscribe']);
 }