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']);
75 $authors = $this->getAuthors();
76 if (count($authors) > 1) {
77 if (isset($authors[0])) {
80 $count = count($authors);
82 return $this->getLanguage()->getDynamicVariable('wcf.user.notification.commentResponse.mail.stacked', [
83 'author' => $this->author,
84 'authors' => array_values($authors),
86 'notificationType' => $notificationType,
87 'others' => $count - 1,
89 'response' => $this->userNotificationObject,
90 'guestTimesTriggered' => $this->notification->guestTimesTriggered
94 return $this->getLanguage()->getDynamicVariable('wcf.user.notification.commentResponse.mail', [
95 'response' => $this->userNotificationObject,
96 'author' => $this->author,
98 'notificationType' => $notificationType
105 public function getLink() {
106 return UserProfileRuntimeCache::getInstance()->getObject($this->additionalData['objectID'])->getLink() . '#wall';
112 public function getEventHash() {
113 return sha1($this->eventID . '-' . $this->userNotificationObject->commentID);