2 namespace wcf\system\user\notification\event;
3 use wcf\data\user\User;
4 use wcf\system\comment\CommentDataHandler;
5 use wcf\system\request\LinkHandler;
9 * User notification event for profile commment likes.
11 * @author Alexander Ebert
12 * @copyright 2001-2014 WoltLab GmbH
13 * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
14 * @package com.woltlab.wcf
15 * @subpackage system.user.notification.event
16 * @category Community Framework
18 class UserProfileCommentLikeUserNotificationEvent extends AbstractSharedUserNotificationEvent {
20 * @see \wcf\system\user\notification\event\AbstractUserNotificationEvent::$stackable
22 protected $stackable = true;
25 * @see \wcf\system\user\notification\event\AbstractUserNotificationEvent::prepare()
27 protected function prepare() {
28 CommentDataHandler::getInstance()->cacheUserID($this->additionalData['objectID']);
32 * @see \wcf\system\user\notification\event\IUserNotificationEvent::getTitle()
34 public function getTitle() {
35 $count = count($this->getAuthors());
37 return $this->getLanguage()->getDynamicVariable('wcf.user.notification.comment.like.title.stacked', array(
39 'timesTriggered' => $this->timesTriggered
43 return $this->getLanguage()->get('wcf.user.notification.comment.like.title');
47 * @see \wcf\system\user\notification\event\IUserNotificationEvent::getMessage()
49 public function getMessage() {
50 $authors = array_values($this->getAuthors());
51 $count = count($authors);
53 if ($this->additionalData['objectID'] != WCF::getUser()->userID) {
54 $owner = CommentDataHandler::getInstance()->getUser($this->additionalData['objectID']);
58 return $this->getLanguage()->getDynamicVariable('wcf.user.notification.comment.like.message.stacked', array(
59 'author' => $this->author,
60 'authors' => $authors,
61 'comment' => $this->userNotificationObject,
63 'others' => $count - 1,
68 return $this->getLanguage()->getDynamicVariable('wcf.user.notification.comment.like.message', array(
69 'author' => $this->author,
70 'comment' => $this->userNotificationObject,
76 * @see \wcf\system\user\notification\event\IUserNotificationEvent::getEmailMessage()
78 public function getEmailMessage($notificationType = 'instant') { /* not supported */ }
81 * @see \wcf\system\user\notification\event\IUserNotificationEvent::getLink()
83 public function getLink() {
84 return LinkHandler::getInstance()->getLink('User', array('object' => WCF::getUser()), '#wall');
88 * @see \wcf\system\user\notification\event\IUserNotificationEvent::getEventHash()
90 public function getEventHash() {
91 return sha1($this->eventID . '-' . $this->additionalData['objectID']);
95 * @see \wcf\system\user\notification\event\IUserNotificationEvent::supportsEmailNotification()
97 public function supportsEmailNotification() {