Apply PSR-12 code style (#3886)
[GitHub/WoltLab/WCF.git] / wcfsetup / install / files / lib / page / NotificationFeedPage.class.php
CommitLineData
40aa9168 1<?php
a9229942 2
40aa9168 3namespace wcf\page;
a9229942 4
40aa9168 5use wcf\system\exception\IllegalLinkException;
6use wcf\system\user\notification\UserNotificationHandler;
7use wcf\system\WCF;
8
9/**
10 * Shows a list of own user notifications in feed.
11 *
a9229942
TD
12 * @author Joshua Ruesweg
13 * @copyright 2001-2019 WoltLab GmbH
14 * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
15 * @package WoltLabSuite\Core\Page
16 * @since 3.0
40aa9168 17 */
a9229942
TD
18class NotificationFeedPage extends AbstractFeedPage
19{
20 /**
21 * @inheritDoc
22 */
23 public function readParameters()
24 {
25 parent::readParameters();
26
27 if (!WCF::getUser()->userID) {
28 throw new IllegalLinkException();
29 }
30
31 $this->title = WCF::getLanguage()->get('wcf.user.menu.community.notification');
32 }
33
34 /**
35 * @inheritDoc
36 */
37 public function readData()
38 {
39 parent::readData();
40
41 $this->items = new \ArrayIterator();
42
43 $notifications = UserNotificationHandler::getInstance()->getNotifications(20);
44
45 foreach ($notifications['notifications'] as $notification) {
46 $this->items->append($notification['event']);
47 }
48 }
40aa9168 49}