GetBookList
in package
Use case for retrieving a list of books.
Tags
Table of Contents
Properties
Methods
- __construct() : mixed
- Constructor.
- execute() : array{books: array{id: int, title: string, author: string|null, languageId: int, sourceType: string, totalChapters: int, currentChapter: int, progress: float, createdAt: string|null, updatedAt: string|null}[], total: int, page: int, perPage: int, totalPages: int}
- Get a paginated list of books.
Properties
$bookRepository
private
BookRepositoryInterface
$bookRepository
Methods
__construct()
Constructor.
public
__construct(BookRepositoryInterface $bookRepository) : mixed
Parameters
- $bookRepository : BookRepositoryInterface
-
Book repository
execute()
Get a paginated list of books.
public
execute([int|null $userId = null ][, int|null $languageId = null ][, int $page = 1 ][, int $perPage = 20 ]) : array{books: array{id: int, title: string, author: string|null, languageId: int, sourceType: string, totalChapters: int, currentChapter: int, progress: float, createdAt: string|null, updatedAt: string|null}[], total: int, page: int, perPage: int, totalPages: int}
Parameters
- $userId : int|null = null
-
User ID for filtering
- $languageId : int|null = null
-
Language ID for filtering
- $page : int = 1
-
Page number (1-based)
- $perPage : int = 20
-
Items per page