a49047bf68105d28fb96fe9baccc94a2ab4627c9
[GitHub/WoltLab/WCF.git] /
1 <?php
2 declare(strict_types=1);
3 namespace wcf\system\user\notification\event;
4 use wcf\data\user\notification\UserNotification;
5 use wcf\data\user\UserProfile;
6 use wcf\system\user\notification\object\IUserNotificationObject;
7
8 /**
9 * Provides a default implementation for objects sharing common data.
10 *
11 * @author Alexander Ebert
12 * @copyright 2001-2018 WoltLab GmbH
13 * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
14 * @package WoltLabSuite\Core\System\User\Notification\Event
15 */
16 abstract class AbstractSharedUserNotificationEvent extends AbstractUserNotificationEvent {
17 /**
18 * @inheritDoc
19 */
20 public function setObject(UserNotification $notification, IUserNotificationObject $object, UserProfile $author, array $additionalData = []) {
21 parent::setObject($notification, $object, $author, $additionalData);
22
23 $this->prepare();
24 }
25
26 /**
27 * Provide specialized handlers with object ids, these ids will be collected and should be
28 * read once the first time data is requested from the notification event.
29 */
30 abstract protected function prepare();
31 }