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 WoltLabSuite\Core\System\User\Notification\Event
15 class UserProfileCommentLikeUserNotificationEvent extends AbstractSharedUserNotificationEvent {
19 protected $stackable = true;
24 protected function prepare() {
25 UserProfileRuntimeCache::getInstance()->cacheObjectID($this->additionalData['objectID']);
31 public function getTitle() {
32 $count = count($this->getAuthors());
34 return $this->getLanguage()->getDynamicVariable('wcf.user.notification.comment.like.title.stacked', [
36 'timesTriggered' => $this->notification->timesTriggered
40 return $this->getLanguage()->get('wcf.user.notification.comment.like.title');
46 public function getMessage() {
47 $authors = array_values($this->getAuthors());
48 $count = count($authors);
50 if ($this->additionalData['objectID'] != WCF::getUser()->userID) {
51 $owner = UserProfileRuntimeCache::getInstance()->getObject($this->additionalData['objectID']);
55 return $this->getLanguage()->getDynamicVariable('wcf.user.notification.comment.like.message.stacked', [
56 'author' => $this->author,
57 'authors' => $authors,
59 'others' => $count - 1,
64 return $this->getLanguage()->getDynamicVariable('wcf.user.notification.comment.like.message', [
65 'author' => $this->author,
73 public function getEmailMessage($notificationType = 'instant') {
74 throw new \LogicException('Unreachable');
80 public function getLink() {
81 $owner = WCF::getUser();
82 if ($this->additionalData['objectID'] != WCF::getUser()->userID) {
83 $owner = UserProfileRuntimeCache::getInstance()->getObject($this->additionalData['objectID']);
86 return LinkHandler::getInstance()->getLink('User', ['object' => $owner], '#wall');
92 public function getEventHash() {
93 return sha1($this->eventID . '-' . $this->additionalData['objectID']);
99 public function supportsEmailNotification() {