Esempio n. 1
0
 /**
  * {@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);
     }
 }
Esempio n. 2
0
 private function getRouteOptions(BookInterface $book, Request $request)
 {
     return array('id' => $book->getId(), '_format' => $request->get('_format'));
 }