Copied!

BookmarkService

BookmarkService.php : 20

Bookmark Service.

Service to handle bookmarking of Content item Locations. It works in the context of a current User (obtained from the PermissionResolver).

Methods

publiccreateBookmark()

BookmarkService.php : 31

Add location to bookmarks.

public createBookmark(Location $location) : void

Parameters

Name Type Default value Description
$location Location - -
Tags
Throws
InvalidArgumentException

When location is already bookmarked

Throws
UnauthorizedException

If the current user user is not allowed to create bookmark

Throws
NotFoundException

publicdeleteBookmark()

BookmarkService.php : 42

Delete given location from bookmarks.

public deleteBookmark(Location $location) : void

Parameters

Name Type Default value Description
$location Location - -
Tags
Throws
InvalidArgumentException

When location is not bookmarked

Throws
UnauthorizedException

if the current user user is not allowed to delete bookmark

Throws
NotFoundException

publicisBookmarked()

BookmarkService.php : 63

Return true if location is bookmarked.

public isBookmarked(Location $location) : bool

Parameters

Name Type Default value Description
$location Location - -

Return values

bool

publicloadBookmarks()

BookmarkService.php : 54

List bookmarked locations.

public loadBookmarks([int $offset = 0 ][, int $limit = 25 ]) : BookmarkList

Parameters

Name Type Default value Description
$offset int 0

the start offset for paging

$limit int 25

the number of bookmarked locations returned

Return values

BookmarkList

Tags
Throws
InvalidArgumentException