diff options
Diffstat (limited to 'application/bookmark/BookmarkServiceInterface.php')
-rw-r--r-- | application/bookmark/BookmarkServiceInterface.php | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/application/bookmark/BookmarkServiceInterface.php b/application/bookmark/BookmarkServiceInterface.php index 37a54d03..08cdbb4e 100644 --- a/application/bookmark/BookmarkServiceInterface.php +++ b/application/bookmark/BookmarkServiceInterface.php | |||
@@ -20,13 +20,14 @@ interface BookmarkServiceInterface | |||
20 | /** | 20 | /** |
21 | * Find a bookmark by hash | 21 | * Find a bookmark by hash |
22 | * | 22 | * |
23 | * @param string $hash | 23 | * @param string $hash Bookmark's hash |
24 | * @param string|null $privateKey Optional key used to access private links while logged out | ||
24 | * | 25 | * |
25 | * @return Bookmark | 26 | * @return Bookmark |
26 | * | 27 | * |
27 | * @throws \Exception | 28 | * @throws \Exception |
28 | */ | 29 | */ |
29 | public function findByHash(string $hash): Bookmark; | 30 | public function findByHash(string $hash, string $privateKey = null); |
30 | 31 | ||
31 | /** | 32 | /** |
32 | * @param $url | 33 | * @param $url |
@@ -155,22 +156,29 @@ interface BookmarkServiceInterface | |||
155 | public function bookmarksCountPerTag(array $filteringTags = [], ?string $visibility = null): array; | 156 | public function bookmarksCountPerTag(array $filteringTags = [], ?string $visibility = null): array; |
156 | 157 | ||
157 | /** | 158 | /** |
158 | * Returns the list of days containing articles (oldest first) | 159 | * Return a list of bookmark matching provided period of time. |
160 | * It also update directly previous and next date outside of given period found in the datastore. | ||
159 | * | 161 | * |
160 | * @return array containing days (in format YYYYMMDD). | 162 | * @param \DateTimeInterface $from Starting date. |
163 | * @param \DateTimeInterface $to Ending date. | ||
164 | * @param \DateTimeInterface|null $previous (by reference) updated with first created date found before $from. | ||
165 | * @param \DateTimeInterface|null $next (by reference) updated with first created date found after $to. | ||
166 | * | ||
167 | * @return array List of bookmarks matching provided period of time. | ||
161 | */ | 168 | */ |
162 | public function days(): array; | 169 | public function findByDate( |
170 | \DateTimeInterface $from, | ||
171 | \DateTimeInterface $to, | ||
172 | ?\DateTimeInterface &$previous, | ||
173 | ?\DateTimeInterface &$next | ||
174 | ): array; | ||
163 | 175 | ||
164 | /** | 176 | /** |
165 | * Returns the list of articles for a given day. | 177 | * Returns the latest bookmark by creation date. |
166 | * | ||
167 | * @param string $request day to filter. Format: YYYYMMDD. | ||
168 | * | 178 | * |
169 | * @return Bookmark[] list of shaare found. | 179 | * @return Bookmark|null Found Bookmark or null if the datastore is empty. |
170 | * | ||
171 | * @throws BookmarkNotFoundException | ||
172 | */ | 180 | */ |
173 | public function filterDay(string $request); | 181 | public function getLatest(): ?Bookmark; |
174 | 182 | ||
175 | /** | 183 | /** |
176 | * Creates the default database after a fresh install. | 184 | * Creates the default database after a fresh install. |