X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=application%2Fbookmark%2FBookmarkServiceInterface.php;h=4b1f0daa69470e4109462b7ad1954a17c038ca58;hb=9b8c0a4560fa1d87cab1529099b1b4677e92e265;hp=37fbda890e2d607552d9b0620ac66f3b4a57cae0;hpb=c4ad3d4f061d05a01db25aa54dda830ba776792d;p=github%2Fshaarli%2FShaarli.git diff --git a/application/bookmark/BookmarkServiceInterface.php b/application/bookmark/BookmarkServiceInterface.php index 37fbda89..4b1f0daa 100644 --- a/application/bookmark/BookmarkServiceInterface.php +++ b/application/bookmark/BookmarkServiceInterface.php @@ -1,73 +1,75 @@ 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. * - * @return array containing days (in format YYYYMMDD). - */ - public function days(); - - /** - * Returns the list of articles for a given day. - * - * @param string $request day to filter. Format: YYYYMMDD. - * - * @return Bookmark[] list of shaare found. + * @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. * - * @throws BookmarkNotFoundException + * @return array List of bookmarks matching provided period of time. */ - public function filterDay($request); + public function findByDate( + \DateTimeInterface $from, + \DateTimeInterface $to, + ?\DateTimeInterface &$previous, + ?\DateTimeInterface &$next + ): array; /** - * Creates the default database after a fresh install. - */ - public function initialize(); - - /** - * Allow to write the datastore from anonymous session (not logged in). + * Returns the latest bookmark by creation date. * - * This covers a few specific use cases, such as datastore initialization, - * but it should be used carefully as it can lead to security issues. + * @return Bookmark|null Found Bookmark or null if the datastore is empty. */ - public function enableAnonymousPermission(); + public function getLatest(): ?Bookmark; /** - * Disable anonymous permission. + * Creates the default database after a fresh install. */ - public function disableAnonymousPermission(); + public function initialize(): void; }