1 | <?php |
||
13 | class ContextManager |
||
14 | { |
||
15 | private $cache; |
||
16 | |||
17 | 3 | public function __construct(CacheInterface $cache) |
|
21 | |||
22 | /** |
||
23 | * Load context. |
||
24 | * |
||
25 | * @param Channel $channel |
||
26 | * @param Driver $driver |
||
27 | * |
||
28 | * @return Context |
||
29 | */ |
||
30 | 1 | public function load(Channel $channel, Driver $driver): Context |
|
40 | |||
41 | /** |
||
42 | * Save context. |
||
43 | * |
||
44 | * @param Context $context |
||
45 | */ |
||
46 | 1 | public function save(Context $context): void |
|
52 | |||
53 | /** |
||
54 | * Clear context. |
||
55 | * |
||
56 | * @param Context $context |
||
57 | */ |
||
58 | 1 | public function clear(Context $context): void |
|
64 | |||
65 | /** |
||
66 | * Get key of context. |
||
67 | * |
||
68 | * @param Channel $channel |
||
69 | * @param Chat $chat |
||
70 | * @param User $user |
||
71 | * |
||
72 | * @return string |
||
73 | */ |
||
74 | 3 | private function key(Channel $channel, Chat $chat, User $user): string |
|
78 | } |
||
79 |