54772a584e1dbaad8049e7e52b754562ee566218
[GitHub/WoltLab/WCF.git] /
1 <?php
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;
7
8 /**
9 * User notification event for profile commment responses.
10 *
11 * @author Alexander Ebert
12 * @copyright 2001-2013 WoltLab GmbH
13 * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
14 * @package com.woltlab.wcf.comment
15 * @subpackage system.user.notification.event
16 * @category Community Framework
17 */
18 class UserProfileCommentResponseUserNotificationEvent extends AbstractUserNotificationEvent {
19 /**
20 * @see wcf\system\user\notification\event\IUserNotificationEvent::getTitle()
21 */
22 public function getTitle() {
23 return $this->getLanguage()->get('wcf.user.notification.commentResponse.title');
24 }
25
26 /**
27 * @see wcf\system\user\notification\event\IUserNotificationEvent::getMessage()
28 */
29 public function getMessage() {
30 // @todo: use cache or a single query to retrieve required data
31 $comment = new Comment($this->userNotificationObject->commentID);
32 $user = new User($comment->objectID);
33
34 return $this->getLanguage()->getDynamicVariable('wcf.user.notification.commentResponse.message', array(
35 'author' => $this->author,
36 'owner' => $user
37 ));
38 }
39
40 /**
41 * @see wcf\system\user\notification\event\IUserNotificationEvent::getEmailMessage()
42 */
43 public function getEmailMessage($notificationType = 'instant') {
44 $comment = new Comment($this->userNotificationObject->commentID);
45 $user = new User($comment->objectID);
46
47 return $this->getLanguage()->getDynamicVariable('wcf.user.notification.commentResponse.mail', array(
48 'author' => $this->author,
49 'owner' => $user
50 ));
51 }
52
53 /**
54 * @see wcf\system\user\notification\event\IUserNotificationEvent::getLink()
55 */
56 public function getLink() {
57 // @todo: use cache or a single query to retrieve required data
58 $comment = new Comment($this->userNotificationObject->commentID);
59 $user = new User($comment->objectID);
60
61 return LinkHandler::getInstance()->getLink('User', array('object' => $user), '#wall');
62 }
63 }