Files
Mangarr/src/Domain/Manga/Application/Response/MangaListResponse.php
ext.jeremy.guillot@maxicoffee.domains 7fba3c6fcb chore: rattrapage
2026-03-14 00:45:29 +01:00

31 lines
597 B
PHP

<?php
namespace App\Domain\Manga\Application\Response;
readonly class MangaListResponse
{
public function __construct(
public array $mangas,
public int $total,
public int $page,
public int $limit,
public array $chapterCounts = []
) {
}
public function getTotalPages(): int
{
return (int) ceil($this->total / $this->limit);
}
public function hasNextPage(): bool
{
return $this->page < $this->getTotalPages();
}
public function hasPreviousPage(): bool
{
return $this->page > 1;
}
}