2 namespace wcf\system\user\notification\event;
3 use wcf\data\user\User;
4 use wcf\system\request\LinkHandler;
7 * User notification event for profile commments.
9 * @author Alexander Ebert
10 * @copyright 2001-2016 WoltLab GmbH
11 * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
12 * @package com.woltlab.wcf
13 * @subpackage system.user.notification.event
14 * @category Community Framework
16 class UserProfileCommentUserNotificationEvent extends AbstractUserNotificationEvent {
20 protected $stackable = true;
25 public function getTitle() {
26 $count = count($this->getAuthors());
28 return $this->getLanguage()->getDynamicVariable('wcf.user.notification.comment.title.stacked', [
30 'timesTriggered' => $this->notification->timesTriggered
34 return $this->getLanguage()->get('wcf.user.notification.comment.title');
40 public function getMessage() {
41 $authors = $this->getAuthors();
42 if (count($authors) > 1) {
43 if (isset($authors[0])) {
46 $count = count($authors);
48 return $this->getLanguage()->getDynamicVariable('wcf.user.notification.comment.message.stacked', [
49 'author' => $this->author,
50 'authors' => array_values($authors),
52 'others' => $count - 1,
53 'guestTimesTriggered' => $this->notification->guestTimesTriggered
57 return $this->getLanguage()->getDynamicVariable('wcf.user.notification.comment.message', [
58 'author' => $this->author
65 public function getEmailMessage($notificationType = 'instant') {
66 $user = new User($this->userNotificationObject->objectID);
68 $authors = $this->getAuthors();
69 if (count($authors) > 1) {
70 if (isset($authors[0])) {
73 $count = count($authors);
75 return $this->getLanguage()->getDynamicVariable('wcf.user.notification.comment.mail.stacked', [
76 'author' => $this->author,
77 'authors' => array_values($authors),
79 'others' => $count - 1,
81 'notificationType' => $notificationType,
82 'guestTimesTriggered' => $this->notification->guestTimesTriggered
86 return $this->getLanguage()->getDynamicVariable('wcf.user.notification.comment.mail', [
87 'comment' => $this->userNotificationObject,
88 'author' => $this->author,
90 'notificationType' => $notificationType
97 public function getLink() {
98 return LinkHandler::getInstance()->getLink('User', ['id' => $this->userNotificationObject->objectID], '#wall');
104 public function getEventHash() {
105 return sha1($this->eventID . '-' . $this->notification->userID);