X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=application%2Fbookmark%2FBookmarkServiceInterface.php;fp=application%2Fbookmark%2FBookmarkServiceInterface.php;h=08cdbb4ed4055cc3f6ef2672b991f9c3b1cfeda7;hb=1409f1c89a7ca01456ae2dcd6357d296e2b99f5a;hp=b9b483eb8ae14ae70582ec5589eb67fd9f066558;hpb=054e03f37fa29da8066f1a637919f13c7e7dc5d2;p=github%2Fshaarli%2FShaarli.git diff --git a/application/bookmark/BookmarkServiceInterface.php b/application/bookmark/BookmarkServiceInterface.php index b9b483eb..08cdbb4e 100644 --- a/application/bookmark/BookmarkServiceInterface.php +++ b/application/bookmark/BookmarkServiceInterface.php @@ -1,79 +1,73 @@ bookmarksCount */ - public function bookmarksCountPerTag($filteringTags = [], $visibility = 'all'); + public function bookmarksCountPerTag(array $filteringTags = [], ?string $visibility = null): array; /** - * Returns the list of days containing articles (oldest first) + * Return a list of bookmark matching provided period of time. + * It also update directly previous and next date outside of given period found in the datastore. + * + * @param \DateTimeInterface $from Starting date. + * @param \DateTimeInterface $to Ending date. + * @param \DateTimeInterface|null $previous (by reference) updated with first created date found before $from. + * @param \DateTimeInterface|null $next (by reference) updated with first created date found after $to. * - * @return array containing days (in format YYYYMMDD). + * @return array List of bookmarks matching provided period of time. */ - public function days(); + public function findByDate( + \DateTimeInterface $from, + \DateTimeInterface $to, + ?\DateTimeInterface &$previous, + ?\DateTimeInterface &$next + ): array; /** - * Returns the list of articles for a given day. + * Returns the latest bookmark by creation date. * - * @param string $request day to filter. Format: YYYYMMDD. - * - * @return Bookmark[] list of shaare found. - * - * @throws BookmarkNotFoundException + * @return Bookmark|null Found Bookmark or null if the datastore is empty. */ - public function filterDay($request); + public function getLatest(): ?Bookmark; /** * Creates the default database after a fresh install. */ - public function initialize(); + public function initialize(): void; }