DeleteBook
in package
Use case for deleting a book and all its chapters.
Tags
Table of Contents
Properties
Methods
- __construct() : mixed
- Constructor.
- execute() : array{success: bool, message: string}
- Delete a book by its ID.
Properties
$bookRepository
private
BookRepositoryInterface
$bookRepository
Methods
__construct()
Constructor.
public
__construct(BookRepositoryInterface $bookRepository) : mixed
Parameters
- $bookRepository : BookRepositoryInterface
-
Book repository
execute()
Delete a book by its ID.
public
execute(int $bookId) : array{success: bool, message: string}
This will cascade delete all associated text chapters due to the foreign key constraint.
Parameters
- $bookId : int
-
Book ID