2 namespace wcf\system\user\notification\event;
3 use wcf\system\comment\CommentDataHandler;
4 use wcf\system\request\LinkHandler;
8 * User notification event for profile commment likes.
10 * @author Alexander Ebert
11 * @copyright 2001-2015 WoltLab GmbH
12 * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
13 * @package com.woltlab.wcf
14 * @subpackage system.user.notification.event
15 * @category Community Framework
17 class UserProfileCommentLikeUserNotificationEvent extends AbstractSharedUserNotificationEvent {
19 * @see \wcf\system\user\notification\event\AbstractUserNotificationEvent::$stackable
21 protected $stackable = true;
24 * @see \wcf\system\user\notification\event\AbstractUserNotificationEvent::prepare()
26 protected function prepare() {
27 CommentDataHandler::getInstance()->cacheUserID($this->additionalData['objectID']);
31 * @see \wcf\system\user\notification\event\IUserNotificationEvent::getTitle()
33 public function getTitle() {
34 $count = count($this->getAuthors());
36 return $this->getLanguage()->getDynamicVariable('wcf.user.notification.comment.like.title.stacked', array(
38 'timesTriggered' => $this->notification->timesTriggered
42 return $this->getLanguage()->get('wcf.user.notification.comment.like.title');
46 * @see \wcf\system\user\notification\event\IUserNotificationEvent::getMessage()
48 public function getMessage() {
49 $authors = array_values($this->getAuthors());
50 $count = count($authors);
52 if ($this->additionalData['objectID'] != WCF::getUser()->userID) {
53 $owner = CommentDataHandler::getInstance()->getUser($this->additionalData['objectID']);
57 return $this->getLanguage()->getDynamicVariable('wcf.user.notification.comment.like.message.stacked', array(
58 'author' => $this->author,
59 'authors' => $authors,
61 'others' => $count - 1,
66 return $this->getLanguage()->getDynamicVariable('wcf.user.notification.comment.like.message', array(
67 'author' => $this->author,
73 * @see \wcf\system\user\notification\event\IUserNotificationEvent::getEmailMessage()
75 public function getEmailMessage($notificationType = 'instant') { /* not supported */ }
78 * @see \wcf\system\user\notification\event\IUserNotificationEvent::getLink()
80 public function getLink() {
81 $owner = WCF::getUser();
82 if ($this->additionalData['objectID'] != WCF::getUser()->userID) {
83 $owner = CommentDataHandler::getInstance()->getUser($this->additionalData['objectID']);
86 return LinkHandler::getInstance()->getLink('User', array(
92 * @see \wcf\system\user\notification\event\IUserNotificationEvent::getEventHash()
94 public function getEventHash() {
95 return sha1($this->eventID . '-' . $this->additionalData['objectID']);
99 * @see \wcf\system\user\notification\event\IUserNotificationEvent::supportsEmailNotification()
101 public function supportsEmailNotification() {