21
21
use eZ \Publish \SPI \Persistence \Bookmark \Handler as BookmarkHandler ;
22
22
use Ibexa \Contracts \Core \Repository \Values \Content \Query \Criterion ;
23
23
use Ibexa \Contracts \Core \Repository \Values \Content \Query \SortClause ;
24
+ use Psr \Log \LoggerInterface ;
25
+ use Psr \Log \NullLogger ;
24
26
25
27
class BookmarkService implements BookmarkServiceInterface
26
28
{
@@ -30,16 +32,16 @@ class BookmarkService implements BookmarkServiceInterface
30
32
/** @var \eZ\Publish\SPI\Persistence\Bookmark\Handler */
31
33
protected $ bookmarkHandler ;
32
34
35
+ private LoggerInterface $ logger ;
36
+
33
37
/**
34
38
* BookmarkService constructor.
35
- *
36
- * @param \eZ\Publish\API\Repository\Repository $repository
37
- * @param \eZ\Publish\SPI\Persistence\Bookmark\Handler $bookmarkHandler
38
39
*/
39
- public function __construct (RepositoryInterface $ repository , BookmarkHandler $ bookmarkHandler )
40
+ public function __construct (RepositoryInterface $ repository , BookmarkHandler $ bookmarkHandler, LoggerInterface $ logger = null )
40
41
{
41
42
$ this ->repository = $ repository ;
42
43
$ this ->bookmarkHandler = $ bookmarkHandler ;
44
+ $ this ->logger = $ logger ?? new NullLogger ();
43
45
}
44
46
45
47
/**
@@ -110,6 +112,8 @@ public function loadBookmarks(int $offset = 0, int $limit = 25): BookmarkList
110
112
111
113
$ result = $ this ->repository ->getlocationService ()->find ($ filter , []);
112
114
} catch (BadStateException $ e ) {
115
+ $ this ->logger ->debug ($ e );
116
+
113
117
return new BookmarkList ();
114
118
}
115
119
0 commit comments