+
+ /**
+ * Delete an existing link by its ID.
+ *
+ * @param Request $request Slim request.
+ * @param Response $response Slim response.
+ * @param array $args Path parameters. including the ID.
+ *
+ * @return Response response.
+ *
+ * @throws ApiLinkNotFoundException generating a 404 error.
+ */
+ public function deleteLink($request, $response, $args)
+ {
+ $id = is_integer_mixed($args['id']) ? (int) $args['id'] : null;
+ if ($id === null || !$this->bookmarkService->exists($id)) {
+ throw new ApiLinkNotFoundException();
+ }
+ $bookmark = $this->bookmarkService->get($id);
+ $this->bookmarkService->remove($bookmark);
+
+ return $response->withStatus(204);
+ }