<?php
namespace wcf\system\user\notification\event;
-use wcf\system\cache\runtime\CommentRuntimeCache;
use wcf\system\cache\runtime\UserProfileRuntimeCache;
-use wcf\system\request\LinkHandler;
/**
- * User notification event for profile commment responses.
+ * User notification event for profile comment responses.
*
* @author Alexander Ebert
* @copyright 2001-2016 WoltLab GmbH
* @inheritDoc
*/
protected function prepare() {
- CommentRuntimeCache::getInstance()->cacheObjectID($this->userNotificationObject->commentID);
UserProfileRuntimeCache::getInstance()->cacheObjectID($this->additionalData['objectID']);
- UserProfileRuntimeCache::getInstance()->cacheObjectID($this->additionalData['userID']);
}
/**
* @inheritDoc
*/
public function getMessage() {
- $comment = CommentRuntimeCache::getInstance()->getObject($this->userNotificationObject->commentID);
- $owner = UserProfileRuntimeCache::getInstance()->getObject($comment->objectID);
+ $owner = UserProfileRuntimeCache::getInstance()->getObject($this->additionalData['objectID']);
$authors = $this->getAuthors();
if (count($authors) > 1) {
* @inheritDoc
*/
public function getEmailMessage($notificationType = 'instant') {
- $comment = CommentRuntimeCache::getInstance()->getObject($this->userNotificationObject->commentID);
- $owner = UserProfileRuntimeCache::getInstance()->getObject($comment->objectID);
+ $owner = UserProfileRuntimeCache::getInstance()->getObject($this->additionalData['objectID']);
$authors = $this->getAuthors();
if (count($authors) > 1) {
* @inheritDoc
*/
public function getLink() {
- $comment = CommentRuntimeCache::getInstance()->getObject($this->userNotificationObject->commentID);
- $user = UserProfileRuntimeCache::getInstance()->getObject($comment->objectID);
-
- return LinkHandler::getInstance()->getLink('User', ['object' => $user], '#wall');
+ return UserProfileRuntimeCache::getInstance()->getObject($this->additionalData['objectID'])->getLink() . '#wall';
}
/**