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-2016 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', ['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', [
42 'author' => $this->author,
43 'authors' => $authors,
45 'others' => $count - 1
49 return $this->getLanguage()->getDynamicVariable('wcf.user.notification.follow.message', ['author' => $this->author]);
53 * @see \wcf\system\user\notification\event\IUserNotificationEvent::getEmailMessage()
55 public function getEmailMessage($notificationType = 'instant') {
56 $authors = array_values($this->getAuthors());
57 $count = count($authors);
60 return $this->getLanguage()->getDynamicVariable('wcf.user.notification.follow.mail.stacked', [
61 'author' => $this->author,
62 'authors' => $authors,
64 'others' => $count - 1,
65 'notificationType' => $notificationType
69 return $this->getLanguage()->getDynamicVariable('wcf.user.notification.follow.mail', ['author' => $this->author]);
73 * @see \wcf\system\user\notification\event\IUserNotificationEvent::getLink()
75 public function getLink() {
76 return LinkHandler::getInstance()->getLink('User', ['object' => $this->author]);
80 * @see \wcf\system\user\notification\event\IUserNotificationEvent::getEventHash()
82 public function getEventHash() {
83 return sha1($this->eventID . '-' . $this->userNotificationObject->followUserID);