예제 #1
0
 public function deleteBookAction($parameters)
 {
     $isbn = $parameters['isbn'];
     $bookRepository = new BookRepository();
     $bookRepository->deleteBook($isbn);
     $this->initRouter("/books/show-all.php");
     $this->router->initControllerAction();
 }
 public function showAction($parameters)
 {
     $area = array_key_exists('area', $parameters) ? $parameters['area'] : 'All';
     $bookRepository = new BookRepository();
     $booksCollection = $bookRepository->getBooksByKnowledgeArea($area);
     $data['books'] = $bookRepository->getArrayFromCollection($booksCollection);
     echo json_encode($data);
 }