-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUserDataSessionLoader.php
More file actions
41 lines (35 loc) · 960 Bytes
/
Copy pathUserDataSessionLoader.php
File metadata and controls
41 lines (35 loc) · 960 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
namespace Fab\Formule\Loader;
/*
* This file is part of the Fab/Formule project under GPLv2 or later.
*
* For the full copyright and license information, please read the
* LICENSE.md file that was distributed with this source code.
*/
/**
* Load user data from session.
*/
class UserDataSessionLoader extends AbstractLoader
{
/**
* @param array $values
* @return array
*/
public function load(array $values): array
{
$userData = $this->getFrontendUser()->user;
if (!empty($userData)) {
$values = array_merge($values, $userData);
}
return $values;
}
/**
* Returns an instance of the current Frontend User.
*
* @return \TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication
*/
protected function getFrontendUser(): \TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication
{
return $GLOBALS['TSFE']->fe_user;
}
}