3 namespace wcf\system\user\notification\event;
5 use wcf\system\cache\runtime\CommentRuntimeCache;
6 use wcf\system\user\notification\object\CommentResponseUserNotificationObject;
9 * Provides a default implementation for user notifications about comment responses.
12 * @copyright 2001-2023 WoltLab GmbH
13 * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
16 * @method CommentResponseUserNotificationObject getUserNotificationObject()
18 abstract class AbstractCommentResponseUserNotificationEvent extends AbstractSharedUserNotificationEvent
23 protected $stackable = true;
28 protected function prepare()
30 CommentRuntimeCache::getInstance()->cacheObjectID($this->getUserNotificationObject()->commentID);
36 public function getTitle(): string
38 $count = \count($this->getAuthors());
40 return $this->getLanguage()->getDynamicVariable('wcf.user.notification.comment.response.title.stacked', [
42 'timesTriggered' => $this->notification->timesTriggered,
43 'typeName' => $this->getTypeName(),
47 return $this->getLanguage()->getDynamicVariable('wcf.user.notification.comment.response.title', [
48 'typeName' => $this->getTypeName(),
55 public function getEmailTitle()
57 $count = \count($this->getAuthors());
59 return $this->getTitle();
62 return $this->getLanguage()->getDynamicVariable('wcf.user.notification.comment.response.mail.title', [
63 'objectTitle' => $this->getObjectTitle(),
64 'typeName' => $this->getTypeName(),
71 public function getEventHash()
73 return \sha1($this->eventID . '-' . $this->getUserNotificationObject()->commentID);
77 * Returns the name of the type to which the comment belong.
79 protected abstract function getTypeName(): string;
82 * Returns the title of the object to which the comment belong.
84 protected abstract function getObjectTitle(): string;