2 namespace wcf\system\user\notification\event;
3 use wcf\system\cache\runtime\UserProfileRuntimeCache;
6 * User notification event for profile comment responses.
8 * @author Alexander Ebert
9 * @copyright 2001-2016 WoltLab GmbH
10 * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
11 * @package WoltLabSuite\Core\System\User\Notification\Event
13 class UserProfileCommentResponseUserNotificationEvent extends AbstractSharedUserNotificationEvent {
17 protected $stackable = true;
22 protected function prepare() {
23 UserProfileRuntimeCache::getInstance()->cacheObjectID($this->additionalData['objectID']);
29 public function getTitle() {
30 $count = count($this->getAuthors());
32 return $this->getLanguage()->getDynamicVariable('wcf.user.notification.commentResponse.title.stacked', [
34 'timesTriggered' => $this->notification->timesTriggered
38 return $this->getLanguage()->get('wcf.user.notification.commentResponse.title');
44 public function getMessage() {
45 $owner = UserProfileRuntimeCache::getInstance()->getObject($this->additionalData['objectID']);
47 $authors = $this->getAuthors();
48 if (count($authors) > 1) {
49 if (isset($authors[0])) {
52 $count = count($authors);
54 return $this->getLanguage()->getDynamicVariable('wcf.user.notification.commentResponse.message.stacked', [
55 'authors' => array_values($authors),
57 'others' => $count - 1,
59 'guestTimesTriggered' => $this->notification->guestTimesTriggered
63 return $this->getLanguage()->getDynamicVariable('wcf.user.notification.commentResponse.message', [
64 'author' => $this->author,
72 public function getEmailMessage($notificationType = 'instant') {
73 $owner = UserProfileRuntimeCache::getInstance()->getObject($this->additionalData['objectID']);
76 'template' => 'email_notification_userProfileCommentResponse',
77 'application' => 'wcf',
87 public function getLink() {
88 return UserProfileRuntimeCache::getInstance()->getObject($this->additionalData['objectID'])->getLink() . '#wall';
94 public function getEventHash() {
95 return sha1($this->eventID . '-' . $this->userNotificationObject->commentID);