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-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 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->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,
60 'comment' => $this->userNotificationObject,
62 'others' => $count - 1,
67 return $this->getLanguage()->getDynamicVariable('wcf.user.notification.comment.like.message', array(
68 'author' => $this->author,
69 'comment' => $this->userNotificationObject,
75 * @see \wcf\system\user\notification\event\IUserNotificationEvent::getEmailMessage()
77 public function getEmailMessage($notificationType = 'instant') { /* not supported */ }
80 * @see \wcf\system\user\notification\event\IUserNotificationEvent::getLink()
82 public function getLink() {
83 return LinkHandler::getInstance()->getLink('User', array('object' => WCF::getUser()), '#wall');
87 * @see \wcf\system\user\notification\event\IUserNotificationEvent::getEventHash()
89 public function getEventHash() {
90 return sha1($this->eventID . '-' . $this->additionalData['objectID']);
94 * @see \wcf\system\user\notification\event\IUserNotificationEvent::supportsEmailNotification()
96 public function supportsEmailNotification() {