1 | <?php |
||
24 | class CurrentUser extends SaitoUser implements CurrentUserInterface |
||
25 | { |
||
26 | /** |
||
27 | * Bookmarks manager |
||
28 | * |
||
29 | * @var Bookmarks |
||
30 | */ |
||
31 | private $bookmarks = null; |
||
32 | |||
33 | /** |
||
34 | * Manages the last refresh/mark entries as read for the current user |
||
35 | * |
||
36 | * @var LastRefreshInterface |
||
37 | */ |
||
38 | private $lastRefresh = null; |
||
39 | |||
40 | /** |
||
41 | * @var ReadPostingsInterface |
||
42 | */ |
||
43 | private $readPostings; |
||
44 | |||
45 | /** |
||
46 | * Stores if a user is logged in. Stored individually for performance. |
||
47 | * |
||
48 | * @var bool |
||
49 | */ |
||
50 | protected $isLoggedIn = false; |
||
51 | |||
52 | /** |
||
53 | * {@inheritDoc} |
||
54 | */ |
||
55 | public function setSettings(array $settings) |
||
61 | |||
62 | /** |
||
63 | * {@inheritDoc} |
||
64 | */ |
||
65 | public function set(string $setting, $value) |
||
78 | |||
79 | /** |
||
80 | * {@inheritDoc} |
||
81 | */ |
||
82 | public function setLastRefresh(LastRefreshInterface $lastRefresh): CurrentUserInterface |
||
88 | |||
89 | /** |
||
90 | * {@inheritDoc} |
||
91 | */ |
||
92 | public function getLastRefresh(): LastRefreshInterface |
||
103 | |||
104 | /** |
||
105 | * {@inheritDoc} |
||
106 | */ |
||
107 | public function setReadPostings(ReadPostingsInterface $readPostings): CurrentUserInterface |
||
113 | |||
114 | /** |
||
115 | * {@inheritDoc} |
||
116 | */ |
||
117 | public function getReadPostings(): ReadPostingsInterface |
||
128 | |||
129 | /** |
||
130 | * {@inheritDoc} |
||
131 | */ |
||
132 | public function hasBookmarked($postingId) |
||
140 | |||
141 | /** |
||
142 | * {@inheritDoc} |
||
143 | */ |
||
144 | public function ignores($userId = null) |
||
152 | |||
153 | /** |
||
154 | * {@inheritDoc} |
||
155 | * |
||
156 | * Time sensitive, might be called a few 100x on entries/index |
||
157 | */ |
||
158 | public function isLoggedIn(): bool |
||
162 | } |
||
163 |