1 | <?php |
||
14 | class SessionProfileStorage implements IProfileStorage |
||
15 | { |
||
16 | use SmartObject; |
||
17 | |||
18 | const SESSION_SECTION = 'SixtyEightPublishers.Application'; |
||
19 | |||
20 | /** @var null|ActiveProfile */ |
||
21 | private $profile; |
||
22 | |||
23 | /** @var \Nette\Http\SessionSection */ |
||
24 | private $session; |
||
25 | |||
26 | /** @var null|callable */ |
||
27 | public $onPersist; |
||
28 | |||
29 | /** @var null|callable */ |
||
30 | public $onProfileSet; |
||
31 | |||
32 | /** |
||
33 | * @param \Nette\Http\Session $session |
||
34 | */ |
||
35 | public function __construct(Session $session) |
||
39 | |||
40 | |||
41 | /************* interface \SixtyEightPublishers\Application\Environment\IProfileStorage *************/ |
||
42 | |||
43 | /** |
||
44 | * {@inheritdoc} |
||
45 | */ |
||
46 | public function setProfile(IProfile $profile) |
||
69 | |||
70 | /** |
||
71 | * @return \SixtyEightPublishers\Application\Environment\ActiveProfile |
||
72 | */ |
||
73 | public function getProfile() : ActiveProfile |
||
77 | |||
78 | /** |
||
79 | * {@inheritdoc} |
||
80 | */ |
||
81 | public function persist() |
||
89 | } |
||
90 |