/** * {@inheritdoc} */ public function delete(BookInterface $book) { $bookId = $book->getId(); try { $this->em->remove($book); $this->em->flush(); return; } catch (\Exception $e) { throw new \Exception("Unable to delete the given resource with id " . $bookId, 500, $e); } }
private function getRouteOptions(BookInterface $book, Request $request) { return array('id' => $book->getId(), '_format' => $request->get('_format')); }