aboutsummaryrefslogtreecommitdiffhomepage
path: root/application/bookmark/BookmarkServiceInterface.php
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2020-10-27 19:59:28 +0100
committerGitHub <noreply@github.com>2020-10-27 19:59:28 +0100
commitb8e5a253ab5521ce2be6c0d3e04e0101527df3c1 (patch)
tree8e3eb3e10088dc4f52e58f2c8cf80f68fc26dbf9 /application/bookmark/BookmarkServiceInterface.php
parent977db7eabc30cd9d84f22330a114cb9d904cb514 (diff)
parent54afb1d6f65f727b20b66582bb63a42c421eea4d (diff)
downloadShaarli-b8e5a253ab5521ce2be6c0d3e04e0101527df3c1.tar.gz
Shaarli-b8e5a253ab5521ce2be6c0d3e04e0101527df3c1.tar.zst
Shaarli-b8e5a253ab5521ce2be6c0d3e04e0101527df3c1.zip
Merge pull request #1595 from ArthurHoaro/feature/daily-period
Diffstat (limited to 'application/bookmark/BookmarkServiceInterface.php')
-rw-r--r--application/bookmark/BookmarkServiceInterface.php27
1 files changed, 17 insertions, 10 deletions
diff --git a/application/bookmark/BookmarkServiceInterface.php b/application/bookmark/BookmarkServiceInterface.php
index 9fa61533..08cdbb4e 100644
--- a/application/bookmark/BookmarkServiceInterface.php
+++ b/application/bookmark/BookmarkServiceInterface.php
@@ -156,22 +156,29 @@ interface BookmarkServiceInterface
156 public function bookmarksCountPerTag(array $filteringTags = [], ?string $visibility = null): array; 156 public function bookmarksCountPerTag(array $filteringTags = [], ?string $visibility = null): array;
157 157
158 /** 158 /**
159 * 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.
160 * 161 *
161 * @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.
162 */ 168 */
163 public function days(): array; 169 public function findByDate(
170 \DateTimeInterface $from,
171 \DateTimeInterface $to,
172 ?\DateTimeInterface &$previous,
173 ?\DateTimeInterface &$next
174 ): array;
164 175
165 /** 176 /**
166 * Returns the list of articles for a given day. 177 * Returns the latest bookmark by creation date.
167 *
168 * @param string $request day to filter. Format: YYYYMMDD.
169 * 178 *
170 * @return Bookmark[] list of shaare found. 179 * @return Bookmark|null Found Bookmark or null if the datastore is empty.
171 *
172 * @throws BookmarkNotFoundException
173 */ 180 */
174 public function filterDay(string $request); 181 public function getLatest(): ?Bookmark;
175 182
176 /** 183 /**
177 * Creates the default database after a fresh install. 184 * Creates the default database after a fresh install.