Documentation

LoanController
in package

Class LoanController

Handles HTTP requests related to loans.

Table of Contents

Properties

$loanService  : LoanService

Methods

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

Properties

Methods

__construct()

Constructor for the LoanController class.

public __construct(LoanService $loanService) : mixed

Initializes the loan service.

Parameters
$loanService : LoanService

The service for managing loans.

delete()

Handles the deletion of a loan by its ID.

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

The ID of the loan to delete.

getAll()

Handles the retrieval of all loans.

public getAll() : void

getById()

Handles the retrieval of a loan by its ID.

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

The ID of the loan to retrieve.

Tags
throws
ResourceNotFoundException

If the loan is not found.

update()

Handles the update of an existing loan.

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

The ID of the loan to be updated.

$data : object

The data for updating the loan.

Tags
throws
BookNotAvailableException

If the book is not available.

throws
ExceedsLoanLimitException

If the user exceeds the loan limit.


        
On this page

Search results