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 response likes.
10 * @author Alexander Ebert
11 * @copyright 2001-2014 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 UserProfileCommentResponseLikeUserNotificationEvent 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']);
28 CommentDataHandler::getInstance()->cacheUserID($this->additionalData['commentUserID']);
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.commentResponse.like.title.stacked', array(
39 'timesTriggered' => $this->timesTriggered
43 return $this->getLanguage()->get('wcf.user.notification.commentResponse.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);
52 $commentUser = $owner = null;
53 if ($this->additionalData['objectID'] != WCF::getUser()->userID) {
54 $owner = CommentDataHandler::getInstance()->getUser($this->additionalData['objectID']);
56 if ($this->additionalData['commentUserID'] != WCF::getUser()->userID) {
57 $commentUser = CommentDataHandler::getInstance()->getUser($this->additionalData['commentUserID']);
61 return $this->getLanguage()->getDynamicVariable('wcf.user.notification.commentResponse.like.message.stacked', array(
62 'author' => $this->author,
63 'authors' => $authors,
64 'commentUser' => $commentUser,
66 'others' => $count - 1,
71 return $this->getLanguage()->getDynamicVariable('wcf.user.notification.commentResponse.like.message', array(
72 'author' => $this->author,
73 'comment' => $this->userNotificationObject,
79 * @see \wcf\system\user\notification\event\IUserNotificationEvent::getEmailMessage()
81 public function getEmailMessage($notificationType = 'instant') { /* not supported */ }
84 * @see \wcf\system\user\notification\event\IUserNotificationEvent::getLink()
86 public function getLink() {
87 return LinkHandler::getInstance()->getLink('User', array('object' => WCF::getUser()), '#wall');
91 * @see \wcf\system\user\notification\event\IUserNotificationEvent::getEventHash()
93 public function getEventHash() {
94 return sha1($this->eventID . '-' . $this->additionalData['commentID']);
98 * @see \wcf\system\user\notification\event\IUserNotificationEvent::supportsEmailNotification()
100 public function supportsEmailNotification() {