Documentation

BookController
in package

Class BookController

Handles HTTP requests related to books.

Table of Contents

Properties

$bookService  : BookService

Methods

__construct()  : mixed
Constructor for the BookController class.
create()  : void
Handles the creation of a new book.
delete()  : void
Handles the deletion of a book by its ID.
getAll()  : void
Handles the retrieval of all books.
getById()  : void
Handles the retrieval of a book by its ID.
update()  : void
Handles the update of an existing book.

Properties

Methods

__construct()

Constructor for the BookController class.

public __construct(BookService $bookService) : mixed

Initializes the book service.

Parameters
$bookService : BookService

The service for managing books.

create()

Handles the creation of a new book.

public create(object $data) : void
Parameters
$data : object

The data for creating the book.

delete()

Handles the deletion of a book by its ID.

public delete(int $idLoan) : void
Parameters
$idLoan : int

The ID of the book to delete.

getAll()

Handles the retrieval of all books.

public getAll() : void

getById()

Handles the retrieval of a book by its ID.

public getById(int $idBook) : void
Parameters
$idBook : int

The ID of the book to retrieve.

Tags
throws
ResourceNotFoundException

If the book is not found.

update()

Handles the update of an existing book.

public update(int $id, object $data) : void
Parameters
$id : int

The ID of the book to be updated.

$data : object

The data for updating the book.


        
On this page

Search results