public function createBookmark(Request $request, int $locationId): RestValue
    {
        $location = $this->locationService->loadLocation($locationId);

        try {
            $this->bookmarkService->createBookmark($location);

            return new Values\ResourceCreated(
                $this->router->generate(
                    'ezpublish_rest_isBookmarked',
                    [
                        'locationId' => $locationId,
                    ]
                )
            );
        } catch (InvalidArgumentException $e) {
            return new Values\Conflict();
        }
    }
public function createBookmark(Request $request, int $locationId): RestValue
    {
        $location = $this->locationService->loadLocation($locationId);

        try {
            $this->bookmarkService->createBookmark($location);

            return new Values\ResourceCreated(
                $this->router->generate(
                    'ezpublish_rest_isBookmarked',
                    [
                        'locationId' => $locationId,
                    ]
                )
            );
        } catch (InvalidArgumentException $e) {
            return new Values\Conflict();
        }
    }
public function createBookmark ( Request $ request , int $ locationId ) : RestValue { $ location = $ this -> locationService -> loadLocation ( $ locationId ) ; try { $ this -> bookmarkService -> createBookmark ( $ location ) ; return new Values \ ResourceCreated ( $ this -> router -> generate ( 'ezpublish_rest_isBookmarked' , [ 'locationId' => $ locationId , ] ) ) ; } catch ( InvalidArgumentException $ e ) { return new Values \ Conflict ( ) ; } }
Add given location to bookmarks.

@param \Symfony\Component\HttpFoundation\Request $request
@param int $locationId

@throws \eZ\Publish\API\Repository\Exceptions\NotFoundException
@throws \eZ\Publish\API\Repository\Exceptions\UnauthorizedException

@return \eZ\Publish\Core\REST\Common\Value
Add given location to bookmarks .