Passed
Push — typo3_11 ( 01c1e2...2a0816 )
by Torben
13:32
created

injectCustomNotificationLogRepository()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
/*
4
 * This file is part of the Extension "sf_event_mgt" for TYPO3 CMS.
5
 *
6
 * For the full copyright and license information, please read the
7
 * LICENSE.txt file that was distributed with this source code.
8
 */
9
10
namespace DERHANSEN\SfEventMgt\Controller;
11
12
use DERHANSEN\SfEventMgt\Domain\Model\Dto\CustomNotification;
13
use DERHANSEN\SfEventMgt\Domain\Model\Dto\EventDemand;
14
use DERHANSEN\SfEventMgt\Domain\Model\Dto\SearchDemand;
15
use DERHANSEN\SfEventMgt\Domain\Model\Event;
16
use DERHANSEN\SfEventMgt\Service;
17
use TYPO3\CMS\Backend\Routing\UriBuilder;
18
use TYPO3\CMS\Backend\Template\Components\ButtonBar;
19
use TYPO3\CMS\Backend\Utility\BackendUtility;
20
use TYPO3\CMS\Backend\View\BackendTemplateView;
21
use TYPO3\CMS\Core\Authentication\BackendUserAuthentication;
22
use TYPO3\CMS\Core\Imaging\Icon;
23
use TYPO3\CMS\Core\Imaging\IconFactory;
24
use TYPO3\CMS\Core\Localization\LanguageService;
25
use TYPO3\CMS\Core\Messaging\FlashMessage;
26
use TYPO3\CMS\Core\Utility\GeneralUtility;
27
use TYPO3\CMS\Extbase\Mvc\View\ViewInterface;
28
use TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder as ExtbaseUriBuilder;
29
use TYPO3\CMS\Extbase\Property\TypeConverter\DateTimeConverter;
30
31
/**
32
 * AdministrationController
33
 *
34
 * Several parts are heavily inspired by ext:news from Georg Ringer
35
 */
36
class AdministrationController extends AbstractController
37
{
38
    const LANG_FILE = 'LLL:EXT:sf_event_mgt/Resources/Private/Language/locallang_be.xlf:';
39
40
    /**
41
     * Backend Template Container
42
     *
43
     * @var string
44
     */
45
    protected $defaultViewObjectName = \TYPO3\CMS\Backend\View\BackendTemplateView::class;
46
47
    /**
48
     * CustomNotificationLogRepository
49
     *
50
     * @var \DERHANSEN\SfEventMgt\Domain\Repository\CustomNotificationLogRepository
51
     */
52
    protected $customNotificationLogRepository;
53
54
    /**
55
     * ExportService
56
     *
57
     * @var \DERHANSEN\SfEventMgt\Service\ExportService
58
     */
59
    protected $exportService;
60
61
    /**
62
     * SettingsService
63
     *
64
     * @var \DERHANSEN\SfEventMgt\Service\SettingsService
65
     */
66
    protected $settingsService;
67
68
    /**
69
     * Backend User Session Service
70
     *
71
     * @var \DERHANSEN\SfEventMgt\Service\BeUserSessionService
72
     */
73
    protected $beUserSessionService;
74
75
    /**
76
     * @var \DERHANSEN\SfEventMgt\Service\MaintenanceService
77
     */
78
    protected $maintenanceService;
79
80
    /**
81
     * The current page uid
82
     *
83
     * @var int
84
     */
85
    protected $pid = 0;
86
87
    /**
88
     * BackendTemplateContainer
89
     *
90
     * @var BackendTemplateView
91
     */
92
    protected $view;
93
94
    /**
95
     * @var IconFactory
96
     */
97
    protected $iconFactory;
98
99
    /**
100
     * DI for $customNotificationLogRepository
101
     *
102
     * @param \DERHANSEN\SfEventMgt\Domain\Repository\CustomNotificationLogRepository $customNotificationLogRepository
103
     */
104
    public function injectCustomNotificationLogRepository(
105
        \DERHANSEN\SfEventMgt\Domain\Repository\CustomNotificationLogRepository $customNotificationLogRepository
106
    ) {
107
        $this->customNotificationLogRepository = $customNotificationLogRepository;
108
    }
109
110
    /**
111
     * DI for $exportService
112
     *
113
     * @param Service\ExportService $exportService
114
     */
115
    public function injectExportService(\DERHANSEN\SfEventMgt\Service\ExportService $exportService)
116
    {
117
        $this->exportService = $exportService;
118
    }
119
120
    /**
121
     * DI for $settingsService
122
     *
123
     * @param Service\SettingsService $settingsService
124
     */
125
    public function injectSettingsService(\DERHANSEN\SfEventMgt\Service\SettingsService $settingsService)
126
    {
127
        $this->settingsService = $settingsService;
128
    }
129
130
    /**
131
     * DI for $beUserSessionService
132
     *
133
     * @param Service\BeUserSessionService $beUserSessionService
134
     */
135
    public function injectBeUserSessionService(\DERHANSEN\SfEventMgt\Service\BeUserSessionService $beUserSessionService)
136
    {
137
        $this->beUserSessionService = $beUserSessionService;
138
    }
139
140
    /**
141
     * DI for $iconFactory
142
     *
143
     * @param IconFactory $iconFactory
144
     */
145
    public function injectIconFactory(IconFactory $iconFactory)
146
    {
147
        $this->iconFactory = $iconFactory;
148
    }
149
150
    /**
151
     * @param Service\MaintenanceService $maintenanceService
152
     */
153
    public function injectMaintenanceService(\DERHANSEN\SfEventMgt\Service\MaintenanceService $maintenanceService)
154
    {
155
        $this->maintenanceService = $maintenanceService;
156
    }
157
158
    /**
159
     * Set up the doc header properly here
160
     *
161
     * @param ViewInterface $view
162
     */
163
    protected function initializeView(ViewInterface $view)
164
    {
165
        /** @var BackendTemplateView $view */
166
        parent::initializeView($view);
167
        if ($this->actionMethodName === 'listAction'
168
            || $this->actionMethodName === 'indexNotifyAction'
169
            || $this->actionMethodName === 'settingsErrorAction'
170
        ) {
171
            $this->registerDocHeaderButtons();
172
173
            $pageRenderer = $this->view->getModuleTemplate()->getPageRenderer();
174
            $pageRenderer->loadRequireJsModule('TYPO3/CMS/Backend/DateTimePicker');
175
176
            $dateFormat = $GLOBALS['TYPO3_CONF_VARS']['SYS']['USdateFormat'] ?
177
                ['MM-DD-YYYY', 'HH:mm MM-DD-YYYY'] :
178
                ['DD-MM-YYYY', 'HH:mm DD-MM-YYYY'];
179
            $pageRenderer->addInlineSetting('DateTimePicker', 'DateFormat', $dateFormat);
180
181
            $this->view->getModuleTemplate()->setFlashMessageQueue($this->controllerContext->getFlashMessageQueue());
0 ignored issues
show
Deprecated Code introduced by
The function TYPO3\CMS\Extbase\Mvc\Co...:getFlashMessageQueue() has been deprecated: since v11, will be removed in v12 ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

181
            $this->view->getModuleTemplate()->setFlashMessageQueue(/** @scrutinizer ignore-deprecated */ $this->controllerContext->getFlashMessageQueue());

This function has been deprecated. The supplier of the function has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.

Loading history...
182
            if ($view instanceof BackendTemplateView) {
0 ignored issues
show
introduced by
$view is always a sub-type of TYPO3\CMS\Backend\View\BackendTemplateView.
Loading history...
183
                $view->getModuleTemplate()->getPageRenderer()->addCssFile(
184
                    'EXT:sf_event_mgt/Resources/Public/Css/administration.css'
185
                );
186
            }
187
        }
188
    }
189
190
    /**
191
     * Register docHeaderButtons
192
     */
193
    protected function registerDocHeaderButtons()
194
    {
195
        $buttonBar = $this->view->getModuleTemplate()->getDocHeaderComponent()->getButtonBar();
196
197
        $uriBuilder = $this->objectManager->get(ExtbaseUriBuilder::class);
0 ignored issues
show
Deprecated Code introduced by
The function TYPO3\CMS\Extbase\Object...ManagerInterface::get() has been deprecated: since TYPO3 10.4, will be removed in version 12.0 ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

197
        $uriBuilder = /** @scrutinizer ignore-deprecated */ $this->objectManager->get(ExtbaseUriBuilder::class);

This function has been deprecated. The supplier of the function has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.

Loading history...
Deprecated Code introduced by
The property TYPO3\CMS\Extbase\Mvc\Co...troller::$objectManager has been deprecated: since v11, will be removed in v12 ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

197
        $uriBuilder = /** @scrutinizer ignore-deprecated */ $this->objectManager->get(ExtbaseUriBuilder::class);

This property has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the property will be removed from the class and what other property to use instead.

Loading history...
198
        $uriBuilder->setRequest($this->request);
199
200
        if ($this->request->getControllerActionName() === 'list') {
201
            $buttons = [
202
                [
203
                    'label' => 'administration.newEvent',
204
                    'link' => $this->getCreateNewRecordUri('tx_sfeventmgt_domain_model_event'),
205
                    'icon' => 'ext-sfeventmgt-event',
206
                    'group' => 1
207
                ],
208
                [
209
                    'label' => 'administration.newLocation',
210
                    'link' => $this->getCreateNewRecordUri('tx_sfeventmgt_domain_model_location'),
211
                    'icon' => 'ext-sfeventmgt-location',
212
                    'group' => 1
213
                ],
214
                [
215
                    'label' => 'administration.newOrganisator',
216
                    'link' => $this->getCreateNewRecordUri('tx_sfeventmgt_domain_model_organisator'),
217
                    'icon' => 'ext-sfeventmgt-organisator',
218
                    'group' => 1
219
                ],
220
                [
221
                    'label' => 'administration.newSpeaker',
222
                    'link' => $this->getCreateNewRecordUri('tx_sfeventmgt_domain_model_speaker'),
223
                    'icon' => 'ext-sfeventmgt-speaker',
224
                    'group' => 1
225
                ],
226
                [
227
                    'label' => 'administration.handleExpiredRegistrations',
228
                    'link' => $uriBuilder->reset()->setRequest($this->request)
229
                        ->uriFor('handleExpiredRegistrations', [], 'Administration'),
230
                    'icon' => 'ext-sfeventmgt-action-handle-expired',
231
                    'group' => 2,
232
                ]
233
            ];
234
            foreach ($buttons as $key => $tableConfiguration) {
235
                $title = $this->getLanguageService()->sL(self::LANG_FILE . $tableConfiguration['label']);
236
                $icon = $this->iconFactory->getIcon($tableConfiguration['icon'], Icon::SIZE_SMALL);
237
                $viewButton = $buttonBar->makeLinkButton()
238
                    ->setHref($tableConfiguration['link'])
239
                    ->setDataAttributes([
240
                        'toggle' => 'tooltip',
241
                        'placement' => 'bottom',
242
                        'title' => $title
243
                        ])
244
                    ->setTitle($title)
245
                    ->setIcon($icon);
246
                $buttonBar->addButton($viewButton, ButtonBar::BUTTON_POSITION_LEFT, $tableConfiguration['group']);
247
            }
248
        }
249
    }
250
251
    /**
252
     * Returns the create new record URL for the given table
253
     *
254
     * @param string $table
255
     * @throws \TYPO3\CMS\Backend\Routing\Exception\RouteNotFoundException
256
     * @return string
257
     */
258
    private function getCreateNewRecordUri($table): string
259
    {
260
        $pid = $this->pid;
261
        $tsConfig = BackendUtility::getPagesTSconfig(0);
262
        if ($pid === 0 && isset($tsConfig['defaultPid.'])
263
            && is_array($tsConfig['defaultPid.'])
264
            && isset($tsConfig['defaultPid.'][$table])
265
        ) {
266
            $pid = (int)$tsConfig['defaultPid.'][$table];
267
        }
268
269
        $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);
270
271
        return $uriBuilder->buildUriFromRoute('record_edit', [
272
            'edit[' . $table . '][' . $pid . ']' => 'new',
273
            'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')
274
        ]);
275
    }
276
277
    /**
278
     * Initialize action
279
     */
280
    public function initializeAction()
281
    {
282
        $this->pid = (int)\TYPO3\CMS\Core\Utility\GeneralUtility::_GET('id');
283
    }
284
285
    /**
286
     * Set date format for fields startDate and endDate
287
     */
288
    public function initializeListAction()
289
    {
290
        if ($this->settings === null || empty($this->settings)) {
291
            $this->redirect('settingsError');
292
        }
293
        $this->arguments->getArgument('searchDemand')
294
            ->getPropertyMappingConfiguration()->forProperty('startDate')
295
            ->setTypeConverterOption(
296
                DateTimeConverter::class,
297
                DateTimeConverter::CONFIGURATION_DATE_FORMAT,
298
                $this->settings['search']['dateFormat']
299
            );
300
        $this->arguments->getArgument('searchDemand')
301
            ->getPropertyMappingConfiguration()->forProperty('endDate')
302
            ->setTypeConverterOption(
303
                DateTimeConverter::class,
304
                DateTimeConverter::CONFIGURATION_DATE_FORMAT,
305
                $this->settings['search']['dateFormat']
306
            );
307
    }
308
309
    /**
310
     * List action for backend module
311
     *
312
     * @param SearchDemand|null $searchDemand SearchDemand
313
     * @param array $overwriteDemand OverwriteDemand
314
     */
315
    public function listAction(?SearchDemand $searchDemand = null, array $overwriteDemand = [])
316
    {
317
        if ($searchDemand !== null) {
318
            $searchDemand->setFields($this->settings['search']['fields'] ?? '');
319
320
            $sessionData = [];
321
            $sessionData['searchDemand'] = $searchDemand->toArray();
322
            $sessionData['overwriteDemand'] = $overwriteDemand;
323
            $this->beUserSessionService->saveSessionData($sessionData);
324
        } else {
325
            // Try to restore search demand from Session
326
            $sessionSearchDemand = $this->beUserSessionService->getSessionDataByKey('searchDemand') ?? [];
327
            $searchDemand = SearchDemand::fromArray($sessionSearchDemand);
328
            $overwriteDemand = $this->beUserSessionService->getSessionDataByKey('overwriteDemand');
329
        }
330
331
        if ($this->isResetFilter()) {
332
            $searchDemand = new SearchDemand();
333
            $overwriteDemand = [];
334
        }
335
336
        $eventDemand = new EventDemand();
337
        $eventDemand = $this->overwriteEventDemandObject($eventDemand, $overwriteDemand ?? []);
0 ignored issues
show
Bug introduced by
It seems like $overwriteDemand ?? array() can also be of type null; however, parameter $overwriteDemand of DERHANSEN\SfEventMgt\Con...riteEventDemandObject() does only seem to accept array, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

337
        $eventDemand = $this->overwriteEventDemandObject($eventDemand, /** @scrutinizer ignore-type */ $overwriteDemand ?? []);
Loading history...
338
        $eventDemand->setOrderFieldAllowed($this->settings['orderFieldAllowed'] ?? '');
339
        $eventDemand->setSearchDemand($searchDemand);
340
        $eventDemand->setStoragePage($this->pid);
341
        $eventDemand->setIgnoreEnableFields(true);
342
343
        $events = [];
344
        if ($this->getBackendUser()->isInWebMount($this->pid)) {
0 ignored issues
show
Bug Best Practice introduced by
The expression $this->getBackendUser()->isInWebMount($this->pid) of type integer|null is loosely compared to true; this is ambiguous if the integer can be 0. You might want to explicitly use !== null instead.

In PHP, under loose comparison (like ==, or !=, or switch conditions), values of different types might be equal.

For integer values, zero is a special case, in particular the following results might be unexpected:

0   == false // true
0   == null  // true
123 == false // false
123 == null  // false

// It is often better to use strict comparison
0 === false // false
0 === null  // false
Loading history...
345
            $events = $this->eventRepository->findDemanded($eventDemand);
346
        }
347
348
        $this->view->assignMultiple([
349
            'pid' => $this->pid,
350
            'events' => $events,
351
            'searchDemand' => $searchDemand,
352
            'orderByFields' => $this->getOrderByFields(),
353
            'orderDirections' => $this->getOrderDirections(),
354
            'overwriteDemand' => $overwriteDemand,
355
        ]);
356
    }
357
358
    /**
359
     * Returns, if reset filter operation has been used
360
     *
361
     * @return bool
362
     */
363
    private function isResetFilter(): bool
364
    {
365
        $resetFilter = false;
366
        if ($this->request->hasArgument('operation')) {
367
            $resetFilter = $this->request->getArgument('operation') === 'reset-filters' ?? false;
368
        }
369
370
        return $resetFilter;
371
    }
372
373
    /**
374
     * Export registrations for a given event
375
     *
376
     * @param int $eventUid Event UID
377
     */
378
    public function exportAction($eventUid)
379
    {
380
        /** @var Event $event */
381
        $event = $this->eventRepository->findByUidIncludeHidden($eventUid);
382
        if ($event) {
0 ignored issues
show
introduced by
$event is of type DERHANSEN\SfEventMgt\Domain\Model\Event, thus it always evaluated to true.
Loading history...
383
            $this->checkEventAccess($event);
384
            $this->exportService->downloadRegistrationsCsv($eventUid, $this->settings['csvExport']);
385
        }
386
        exit();
0 ignored issues
show
Best Practice introduced by
Using exit here is not recommended.

In general, usage of exit should be done with care and only when running in a scripting context like a CLI script.

Loading history...
387
    }
388
389
    /**
390
     * Handles expired registrations
391
     */
392
    public function handleExpiredRegistrationsAction()
393
    {
394
        $delete = (bool)$this->settings['registration']['deleteExpiredRegistrations'];
395
        $this->maintenanceService->handleExpiredRegistrations($delete);
396
397
        $this->addFlashMessage(
398
            $this->getLanguageService()->sL(self::LANG_FILE . 'administration.message-1.content'),
399
            $this->getLanguageService()->sL(self::LANG_FILE . 'administration.message-1.title'),
400
            FlashMessage::OK
401
        );
402
403
        $this->redirect('list');
404
    }
405
406
    /**
407
     * The index notify action
408
     *
409
     * @param \DERHANSEN\SfEventMgt\Domain\Model\Event $event Event
410
     */
411
    public function indexNotifyAction(Event $event)
412
    {
413
        $this->checkEventAccess($event);
414
        $customNotification = GeneralUtility::makeInstance(CustomNotification::class);
415
        $customNotifications = $this->settingsService->getCustomNotifications($this->settings);
416
        $logEntries = $this->customNotificationLogRepository->findByEvent($event);
0 ignored issues
show
Bug introduced by
The method findByEvent() does not exist on DERHANSEN\SfEventMgt\Dom...tificationLogRepository. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

416
        /** @scrutinizer ignore-call */ 
417
        $logEntries = $this->customNotificationLogRepository->findByEvent($event);
Loading history...
417
        $this->view->assignMultiple([
418
            'event' => $event,
419
            'recipients' => $this->getNotificationRecipients(),
420
            'customNotification' => $customNotification,
421
            'customNotifications' => $customNotifications,
422
            'logEntries' => $logEntries,
423
        ]);
424
    }
425
426
    /**
427
     * Returns an array of recipient option for the indexNotify action
428
     *
429
     * @return array|array[]
430
     */
431
    public function getNotificationRecipients(): array
432
    {
433
        return [
434
            [
435
                'value' => CustomNotification::RECIPIENTS_ALL,
436
                'label' => $this->getLanguageService()->sL(
437
                    self::LANG_FILE . 'administration.notify.recipients.' . CustomNotification::RECIPIENTS_ALL
438
                )
439
            ],
440
            [
441
                'value' => CustomNotification::RECIPIENTS_CONFIRMED,
442
                'label' => $this->getLanguageService()->sL(
443
                    self::LANG_FILE . 'administration.notify.recipients.' . CustomNotification::RECIPIENTS_CONFIRMED
444
                )
445
            ],
446
            [
447
                'value' => CustomNotification::RECIPIENTS_UNCONFIRMED,
448
                'label' => $this->getLanguageService()->sL(
449
                    self::LANG_FILE . 'administration.notify.recipients.' . CustomNotification::RECIPIENTS_UNCONFIRMED
450
                )
451
            ],
452
        ];
453
    }
454
455
    /**
456
     * Notify action
457
     *
458
     * @param Event $event Event
459
     * @param CustomNotification $customNotification
460
     */
461
    public function notifyAction(Event $event, CustomNotification $customNotification)
462
    {
463
        $this->checkEventAccess($event);
464
        $customNotifications = $this->settingsService->getCustomNotifications($this->settings);
465
        $result = $this->notificationService->sendCustomNotification($event, $customNotification, $this->settings);
466
        $this->notificationService->createCustomNotificationLogentry(
467
            $event,
468
            $customNotifications[$customNotification->getTemplate()],
469
            $result
470
        );
471
        $this->addFlashMessage(
472
            $this->getLanguageService()->sL(self::LANG_FILE . 'administration.message-2.content'),
473
            $this->getLanguageService()->sL(self::LANG_FILE . 'administration.message-2.title'),
474
            FlashMessage::OK
475
        );
476
        $this->redirect('list');
477
    }
478
479
    /**
480
     * Checks if the current backend user has access to the PID of the event and if not, enqueue an
481
     * access denied flash message and redirect to list view
482
     *
483
     * @param Event $event
484
     * @throws \TYPO3\CMS\Extbase\Mvc\Exception\StopActionException
485
     */
486
    public function checkEventAccess(Event $event)
487
    {
488
        if ($this->getBackendUser()->isInWebMount($event->getPid()) === null) {
489
            $this->addFlashMessage(
490
                $this->getLanguageService()->sL(self::LANG_FILE . 'administration.accessdenied.content'),
491
                $this->getLanguageService()->sL(self::LANG_FILE . 'administration.accessdenied.title'),
492
                FlashMessage::ERROR
493
            );
494
495
            $this->redirect('list');
496
        }
497
    }
498
499
    /**
500
     * Shows the settings error view
501
     */
502
    public function settingsErrorAction()
503
    {
504
    }
505
506
    /**
507
     * Suppress default validation messages
508
     *
509
     * @return bool
510
     */
511
    protected function getErrorFlashMessage()
512
    {
513
        return false;
514
    }
515
516
    /**
517
     * Returns the LanguageService
518
     *
519
     * @return LanguageService
520
     */
521
    protected function getLanguageService(): LanguageService
522
    {
523
        return $GLOBALS['LANG'];
524
    }
525
526
    /**
527
     * Returns an array with possible order directions
528
     *
529
     * @return array
530
     */
531
    public function getOrderDirections()
532
    {
533
        return [
534
            'asc' => $this->getLanguageService()->sL(self::LANG_FILE . 'administration.sortOrder.asc'),
535
            'desc' => $this->getLanguageService()->sL(self::LANG_FILE . 'administration.sortOrder.desc')
536
        ];
537
    }
538
539
    /**
540
     * Returns an array with possible orderBy fields
541
     *
542
     * @return array
543
     */
544
    public function getOrderByFields()
545
    {
546
        return [
547
            'title' => $this->getLanguageService()->sL(self::LANG_FILE . 'administration.orderBy.title'),
548
            'startdate' => $this->getLanguageService()->sL(self::LANG_FILE . 'administration.orderBy.startdate'),
549
            'enddate' => $this->getLanguageService()->sL(self::LANG_FILE . 'administration.orderBy.enddate')
550
        ];
551
    }
552
553
    /**
554
     * Returns the Backend User
555
     * @return BackendUserAuthentication
556
     */
557
    protected function getBackendUser(): BackendUserAuthentication
558
    {
559
        return $GLOBALS['BE_USER'];
560
    }
561
}
562