3847d9a328c45d0af24c4074d45c24761d3cb97e
[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
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 'response' => $this->userNotificationObject,
49 'author' => $this->author,
50 'owner' => $user,
51 'notificationType' => $notificationType
52 ));
53 }
54
55 /**
56 * @see wcf\system\user\notification\event\IUserNotificationEvent::getLink()
57 */
58 public function getLink() {
59 // @todo: use cache or a single query to retrieve required data
60 $comment = new Comment($this->userNotificationObject->commentID);
61 $user = new User($comment->objectID);
62
63 return LinkHandler::getInstance()->getLink('User', array('object' => $user), '#wall');
64 }
65 }