2 namespace wcf\system\user\notification\event;
3 use wcf\data\comment\Comment;
4 use wcf\data\user\User;
5 use wcf\system\request\LinkHandler;
6 use wcf\system\user\notification\event\AbstractUserNotificationEvent;
9 * User notification event for profile commment responses.
11 * @author Alexander Ebert
12 * @copyright 2001-2014 WoltLab GmbH
13 * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
14 * @package com.woltlab.wcf
15 * @subpackage system.user.notification.event
16 * @category Community Framework
18 class UserProfileCommentResponseUserNotificationEvent extends AbstractUserNotificationEvent {
20 * @see \wcf\system\user\notification\event\IUserNotificationEvent::getTitle()
22 public function getTitle() {
23 return $this->getLanguage()->get('wcf.user.notification.commentResponse.title');
27 * @see \wcf\system\user\notification\event\IUserNotificationEvent::getMessage()
29 public function getMessage() {
30 // @todo: use cache or a single query to retrieve required data
31 $comment = new Comment($this->userNotificationObject->commentID);
32 if ($comment->userID) {
33 $commentAuthor = new User($comment->userID);
36 $commentAuthor = new User(null, array(
37 'username' => $comment->username
41 return $this->getLanguage()->getDynamicVariable('wcf.user.notification.commentResponse.message', array(
42 'author' => $this->author,
48 * @see \wcf\system\user\notification\event\IUserNotificationEvent::getEmailMessage()
50 public function getEmailMessage($notificationType = 'instant') {
51 $comment = new Comment($this->userNotificationObject->commentID);
52 $user = new User($comment->objectID);
54 return $this->getLanguage()->getDynamicVariable('wcf.user.notification.commentResponse.mail', array(
55 'response' => $this->userNotificationObject,
56 'author' => $this->author,
58 'notificationType' => $notificationType
63 * @see \wcf\system\user\notification\event\IUserNotificationEvent::getLink()
65 public function getLink() {
66 // @todo: use cache or a single query to retrieve required data
67 $comment = new Comment($this->userNotificationObject->commentID);
68 $user = new User($comment->objectID);
70 return LinkHandler::getInstance()->getLink('User', array('object' => $user), '#wall');