示例#1
0
 public function restore($user, $reason = '')
 {
     $this->unMarkInProps(WPP_WALL_REMOVE);
     $this->unMarkInProps(WPP_WALL_ADMINDELETE);
     $this->unMarkInProps(WPP_WALL_MODERATORREMOVE);
     $this->customActionNotifyRC($user, 'wall_restore', $reason);
     $wne = $this->getAdminNotificationEntity($user, $reason);
     $wh = new WallHistory($this->cityId);
     $wh->add(WH_RESTORE, $wne, $user);
     $this->addWatch($user);
     $wn = new WallNotifications();
     if ($this->isMain()) {
         $wn->unhideNotificationsForUniqueID($this->cityId, $this->getId());
         $this->getWall()->invalidateCache();
         $wna = new WallNotificationsAdmin();
         $wna->removeForThread($this->cityId, $this->getId());
         $wno = new WallNotificationsOwner();
         $wno->removeForThread($this->cityId, $this->getWallOwner()->getId(), $this->getId());
     } else {
         $this->getThread()->invalidateCache();
         $wna = new WallNotificationsAdmin();
         $wna->removeForReply($this->cityId, $this->getId());
         $wno = new WallNotificationsOwner();
         $wno->removeForReply($this->cityId, $this->getWallOwner()->getId(), $this->getId());
     }
 }
示例#2
0
 public function sendNotification($revOldId, $rcType = RC_NEW, $useMasterDB = false)
 {
     $app = F::App();
     $rev = Revision::newFromId($revOldId);
     $notif = WallNotificationEntity::createFromRev($rev, $useMasterDB);
     $wh = new WallHistory($app->wg->CityId);
     $wh->add($rcType == RC_NEW ? WH_NEW : WH_EDIT, $notif, $app->wg->User);
     if ($rcType == RC_NEW) {
         $wn = new WallNotifications();
         $wn->addNotification($notif);
     }
 }