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;
10 * User notification event for profile's owner for commment responses.
12 * @author Alexander Ebert
13 * @copyright 2001-2014 WoltLab GmbH
14 * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
15 * @package com.woltlab.wcf
16 * @subpackage system.user.notification.event
17 * @category Community Framework
19 class UserProfileCommentResponseOwnerUserNotificationEvent extends AbstractUserNotificationEvent {
21 * @see \wcf\system\user\notification\event\IUserNotificationEvent::getTitle()
23 public function getTitle() {
24 return $this->getLanguage()->get('wcf.user.notification.commentResponseOwner.title');
28 * @see \wcf\system\user\notification\event\IUserNotificationEvent::getMessage()
30 public function getMessage() {
31 // @todo: use cache or a single query to retrieve required data
32 $comment = new Comment($this->userNotificationObject->commentID);
33 $commentAuthor = new User($comment->userID);
35 return $this->getLanguage()->getDynamicVariable('wcf.user.notification.commentResponseOwner.message', array(
36 'author' => $this->author,
37 'commentAuthor' => $commentAuthor
42 * @see \wcf\system\user\notification\event\IUserNotificationEvent::getEmailMessage()
44 public function getEmailMessage($notificationType = 'instant') {
45 $comment = new Comment($this->userNotificationObject->commentID);
46 $commentAuthor = new User($comment->userID);
47 $owner = new User($comment->objectID);
49 return $this->getLanguage()->getDynamicVariable('wcf.user.notification.commentResponseOwner.mail', array(
50 'response' => $this->userNotificationObject,
51 'author' => $this->author,
52 'commentAuthor' => $commentAuthor,
54 'notificationType' => $notificationType
59 * @see \wcf\system\user\notification\event\IUserNotificationEvent::getLink()
61 public function getLink() {
62 return LinkHandler::getInstance()->getLink('User', array('object' => WCF::getUser()), '#wall');