1 | <?php |
||
26 | class CurrentUser extends SaitoUser implements CurrentUserInterface |
||
27 | { |
||
28 | /** |
||
29 | * Bookmarks manager |
||
30 | * |
||
31 | * @var Bookmarks |
||
32 | */ |
||
33 | private $bookmarks = null; |
||
34 | |||
35 | /** |
||
36 | * Manages the last refresh/mark entries as read for the current user |
||
37 | * |
||
38 | * @var LastRefreshInterface |
||
39 | */ |
||
40 | private $lastRefresh = null; |
||
41 | |||
42 | /** |
||
43 | * @var ReadPostingsInterface |
||
44 | */ |
||
45 | private $readPostings; |
||
46 | |||
47 | /** |
||
48 | * Categories |
||
49 | * |
||
50 | * @var Categories |
||
51 | */ |
||
52 | private $categories; |
||
53 | |||
54 | /** |
||
55 | * Permissions |
||
56 | * |
||
57 | * @var Permission |
||
58 | */ |
||
59 | private $permissions; |
||
60 | |||
61 | /** |
||
62 | * Stores if a user is logged in. Stored individually for performance. |
||
63 | * |
||
64 | * @var bool |
||
65 | */ |
||
66 | protected $isLoggedIn = false; |
||
67 | |||
68 | /** |
||
69 | * {@inheritDoc} |
||
70 | */ |
||
71 | public function setSettings(array $settings): void |
||
78 | |||
79 | /** |
||
80 | * {@inheritDoc} |
||
81 | */ |
||
82 | public function set(string $setting, $value) |
||
95 | |||
96 | /** |
||
97 | * {@inheritDoc} |
||
98 | */ |
||
99 | public function setLastRefresh(LastRefreshInterface $lastRefresh): CurrentUserInterface |
||
105 | |||
106 | /** |
||
107 | * {@inheritDoc} |
||
108 | */ |
||
109 | public function getLastRefresh(): LastRefreshInterface |
||
120 | |||
121 | /** |
||
122 | * {@inheritDoc} |
||
123 | */ |
||
124 | public function setReadPostings(ReadPostingsInterface $readPostings): CurrentUserInterface |
||
130 | |||
131 | /** |
||
132 | * {@inheritDoc} |
||
133 | */ |
||
134 | public function getReadPostings(): ReadPostingsInterface |
||
145 | |||
146 | /** |
||
147 | * {@inheritDoc} |
||
148 | */ |
||
149 | public function setCategories(Categories $categories): CurrentUserInterface |
||
155 | |||
156 | /** |
||
157 | * {@inheritDoc} |
||
158 | */ |
||
159 | public function getCategories(): Categories |
||
170 | |||
171 | /** |
||
172 | * {@inheritDoc} |
||
173 | */ |
||
174 | public function hasBookmarked($postingId) |
||
182 | |||
183 | /** |
||
184 | * {@inheritDoc} |
||
185 | */ |
||
186 | public function ignores($userId = null) |
||
194 | |||
195 | /** |
||
196 | * {@inheritDoc} |
||
197 | * |
||
198 | * Time sensitive, might be called a few 100x on entries/index |
||
199 | */ |
||
200 | public function isLoggedIn(): bool |
||
204 | |||
205 | /** |
||
206 | * {@inheritDoc} |
||
207 | */ |
||
208 | public function permission(string $resource): bool |
||
212 | |||
213 | /** |
||
214 | * {@inheritDoc} |
||
215 | */ |
||
216 | public function getPermissions(): Permission |
||
220 | } |
||
221 |