2 namespace wcf\system\user\notification\event;
3 use wcf\system\request\LinkHandler;
6 * Notification event for followers.
8 * @author Alexander Ebert
9 * @copyright 2001-2014 WoltLab GmbH
10 * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
11 * @package com.woltlab.wcf
12 * @subpackage system.user.notification.event
13 * @category Community Framework
15 class UserFollowFollowingUserNotificationEvent extends AbstractUserNotificationEvent {
17 * @see \wcf\system\user\notification\event\AbstractUserNotificationEvent::$stackable
19 protected $stackable = true;
22 * @see \wcf\system\user\notification\event\IUserNotificationEvent::getTitle()
24 public function getTitle() {
25 $count = count($this->getAuthors());
27 return $this->getLanguage()->getDynamicVariable('wcf.user.notification.follow.title.stacked', array('count' => $count));
30 return $this->getLanguage()->get('wcf.user.notification.follow.title');
34 * @see \wcf\system\user\notification\event\IUserNotificationEvent::getMessage()
36 public function getMessage() {
37 $authors = array_values($this->getAuthors());
38 $count = count($authors);
41 return $this->getLanguage()->getDynamicVariable('wcf.user.notification.follow.message.stacked', array(
42 'author' => $this->author,
43 'authors' => $authors,
45 'others' => max($count - 1, 0)
49 return $this->getLanguage()->getDynamicVariable('wcf.user.notification.follow.message', array('author' => $this->author));
53 * @see \wcf\system\user\notification\event\IUserNotificationEvent::getEmailMessage()
55 public function getEmailMessage($notificationType = 'instant') {
56 return $this->getLanguage()->getDynamicVariable('wcf.user.notification.follow.mail', array('author' => $this->author));
60 * @see \wcf\system\user\notification\event\IUserNotificationEvent::getLink()
62 public function getLink() {
63 return LinkHandler::getInstance()->getLink('User', array('object' => $this->author));
67 * @see \wcf\system\user\notification\event\IUserNotificationEvent::getEventHash()
69 public function getEventHash() {
70 return sha1($this->eventID . '-' . $this->userNotificationObject->followUserID);