Total Complexity | 6 |
Total Lines | 41 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
16 | class BeUserSessionService |
||
17 | { |
||
18 | private const SESSION_KEY = 'sf_event_mgt'; |
||
19 | |||
20 | /** |
||
21 | * Saves the given data to the session |
||
22 | */ |
||
23 | public function saveSessionData(array $data): void |
||
24 | { |
||
25 | $this->getBackendUser()->setAndSaveSessionData(self::SESSION_KEY, $data); |
||
26 | } |
||
27 | |||
28 | /** |
||
29 | * Returns the session data |
||
30 | * |
||
31 | * @return mixed |
||
32 | */ |
||
33 | public function getSessionData() |
||
34 | { |
||
35 | return $this->getBackendUser()->getSessionData(self::SESSION_KEY); |
||
36 | } |
||
37 | |||
38 | /** |
||
39 | * Returns a specific value from the session data by the given key |
||
40 | * |
||
41 | * @return mixed|null |
||
42 | */ |
||
43 | public function getSessionDataByKey(string $key) |
||
52 | } |
||
53 | |||
54 | protected function getBackendUser(): ?BackendUserAuthentication |
||
57 | } |
||
58 | } |
||
59 |