From 5dc6c9c415c34be026155b049babaa402bb243f8 Mon Sep 17 00:00:00 2001 From: Marcel Werk Date: Thu, 27 Apr 2023 16:06:50 +0200 Subject: [PATCH] Move generic cache preparing to `AbstractCommentResponseUserNotificationEvent` --- ...ractCommentResponseUserNotificationEvent.class.php | 8 ++++++++ ...ommentResponseOwnerUserNotificationEvent.class.php | 11 ----------- ...icleCommentResponseUserNotificationEvent.class.php | 10 ---------- 3 files changed, 8 insertions(+), 21 deletions(-) diff --git a/wcfsetup/install/files/lib/system/user/notification/event/AbstractCommentResponseUserNotificationEvent.class.php b/wcfsetup/install/files/lib/system/user/notification/event/AbstractCommentResponseUserNotificationEvent.class.php index 7a56a4b45f..8845425c47 100644 --- a/wcfsetup/install/files/lib/system/user/notification/event/AbstractCommentResponseUserNotificationEvent.class.php +++ b/wcfsetup/install/files/lib/system/user/notification/event/AbstractCommentResponseUserNotificationEvent.class.php @@ -22,6 +22,14 @@ abstract class AbstractCommentResponseUserNotificationEvent extends AbstractShar */ protected $stackable = true; + /** + * @inheritDoc + */ + protected function prepare() + { + CommentRuntimeCache::getInstance()->cacheObjectID($this->getUserNotificationObject()->commentID); + } + /** * @inheritDoc */ diff --git a/wcfsetup/install/files/lib/system/user/notification/event/ArticleCommentResponseOwnerUserNotificationEvent.class.php b/wcfsetup/install/files/lib/system/user/notification/event/ArticleCommentResponseOwnerUserNotificationEvent.class.php index c8a3e0579e..d4e42842cf 100644 --- a/wcfsetup/install/files/lib/system/user/notification/event/ArticleCommentResponseOwnerUserNotificationEvent.class.php +++ b/wcfsetup/install/files/lib/system/user/notification/event/ArticleCommentResponseOwnerUserNotificationEvent.class.php @@ -7,7 +7,6 @@ use wcf\system\cache\runtime\CommentRuntimeCache; use wcf\system\cache\runtime\UserProfileRuntimeCache; use wcf\system\cache\runtime\ViewableArticleContentRuntimeCache; use wcf\system\email\Email; -use wcf\system\user\notification\object\CommentResponseUserNotificationObject; /** * User notification event for article comment responses. @@ -16,8 +15,6 @@ use wcf\system\user\notification\object\CommentResponseUserNotificationObject; * @copyright 2001-2019 WoltLab GmbH * @license GNU Lesser General Public License * @since 5.2 - * - * @method CommentResponseUserNotificationObject getUserNotificationObject() */ class ArticleCommentResponseOwnerUserNotificationEvent extends AbstractCommentResponseUserNotificationEvent implements ITestableUserNotificationEvent @@ -25,14 +22,6 @@ class ArticleCommentResponseOwnerUserNotificationEvent extends AbstractCommentRe use TTestableCommentResponseUserNotificationEvent; use TTestableArticleCommentUserNotificationEvent; - /** - * @inheritDoc - */ - protected function prepare() - { - CommentRuntimeCache::getInstance()->cacheObjectID($this->getUserNotificationObject()->commentID); - } - /** * @inheritDoc */ diff --git a/wcfsetup/install/files/lib/system/user/notification/event/ArticleCommentResponseUserNotificationEvent.class.php b/wcfsetup/install/files/lib/system/user/notification/event/ArticleCommentResponseUserNotificationEvent.class.php index 352b027e57..c2df7ac315 100644 --- a/wcfsetup/install/files/lib/system/user/notification/event/ArticleCommentResponseUserNotificationEvent.class.php +++ b/wcfsetup/install/files/lib/system/user/notification/event/ArticleCommentResponseUserNotificationEvent.class.php @@ -14,8 +14,6 @@ use wcf\system\user\notification\object\CommentResponseUserNotificationObject; * @copyright 2001-2019 WoltLab GmbH * @license GNU Lesser General Public License * @since 5.2 - * - * @method CommentResponseUserNotificationObject getUserNotificationObject() */ class ArticleCommentResponseUserNotificationEvent extends AbstractCommentResponseUserNotificationEvent implements ITestableUserNotificationEvent @@ -23,14 +21,6 @@ class ArticleCommentResponseUserNotificationEvent extends AbstractCommentRespons use TTestableCommentResponseUserNotificationEvent; use TTestableArticleCommentUserNotificationEvent; - /** - * @inheritDoc - */ - protected function prepare() - { - CommentRuntimeCache::getInstance()->cacheObjectID($this->getUserNotificationObject()->commentID); - } - /** * @inheritDoc */ -- 2.20.1