2 namespace wcf\system\user\notification\event;
3 use wcf\system\cache\runtime\UserProfileRuntimeCache;
4 use wcf\system\request\LinkHandler;
8 * User notification event for profile commment likes.
10 * @author Alexander Ebert
11 * @copyright 2001-2016 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 {
21 protected $stackable = true;
26 protected function prepare() {
27 UserProfileRuntimeCache::getInstance()->cacheObjectID($this->additionalData['objectID']);
33 public function getTitle() {
34 $count = count($this->getAuthors());
36 return $this->getLanguage()->getDynamicVariable('wcf.user.notification.comment.like.title.stacked', [
38 'timesTriggered' => $this->notification->timesTriggered
42 return $this->getLanguage()->get('wcf.user.notification.comment.like.title');
48 public function getMessage() {
49 $authors = array_values($this->getAuthors());
50 $count = count($authors);
52 if ($this->additionalData['objectID'] != WCF::getUser()->userID) {
53 $owner = UserProfileRuntimeCache::getInstance()->getObject($this->additionalData['objectID']);
57 return $this->getLanguage()->getDynamicVariable('wcf.user.notification.comment.like.message.stacked', [
58 'author' => $this->author,
59 'authors' => $authors,
61 'others' => $count - 1,
66 return $this->getLanguage()->getDynamicVariable('wcf.user.notification.comment.like.message', [
67 'author' => $this->author,
75 public function getEmailMessage($notificationType = 'instant') {
82 public function getLink() {
83 $owner = WCF::getUser();
84 if ($this->additionalData['objectID'] != WCF::getUser()->userID) {
85 $owner = UserProfileRuntimeCache::getInstance()->getObject($this->additionalData['objectID']);
88 return LinkHandler::getInstance()->getLink('User', ['object' => $owner], '#wall');
94 public function getEventHash() {
95 return sha1($this->eventID . '-' . $this->additionalData['objectID']);
101 public function supportsEmailNotification() {