1 | <?php |
||
10 | class SessionTransport implements Transport |
||
11 | { |
||
12 | /** |
||
13 | * @var SessionStore |
||
14 | */ |
||
15 | private $session; |
||
16 | |||
17 | /** |
||
18 | * @var string |
||
19 | */ |
||
20 | private $key; |
||
21 | |||
22 | /** |
||
23 | * @param SessionStore $session |
||
24 | * @param string $key |
||
25 | */ |
||
26 | 12 | public function __construct(SessionStore $session, $key = 'notifications') |
|
35 | |||
36 | /** |
||
37 | * @return void |
||
38 | */ |
||
39 | 3 | private function moveNewNotificationsToCurrent() |
|
45 | |||
46 | /** |
||
47 | * @param Notification $notification |
||
48 | * @return void |
||
49 | */ |
||
50 | 3 | public function send(Notification $notification) |
|
57 | |||
58 | /** |
||
59 | * @return Notifications |
||
60 | */ |
||
61 | 6 | public function getCurrentNotifications() |
|
67 | |||
68 | /** |
||
69 | * @return string |
||
70 | */ |
||
71 | 12 | private function newKey() |
|
75 | |||
76 | /** |
||
77 | * @return string |
||
78 | */ |
||
79 | 6 | private function currentKey() |
|
83 | } |
||
84 |