| 1 | <?php |
||
| 21 | class PaginatedResourceCollection extends ResourceCollection |
||
| 22 | { |
||
| 23 | /** |
||
| 24 | * @var int |
||
| 25 | */ |
||
| 26 | private $limit; |
||
| 27 | |||
| 28 | /** |
||
| 29 | * @var int |
||
| 30 | */ |
||
| 31 | private $page; |
||
| 32 | |||
| 33 | /** |
||
| 34 | * @var int |
||
| 35 | */ |
||
| 36 | private $total; |
||
| 37 | |||
| 38 | /** |
||
| 39 | * Constructor. |
||
| 40 | * |
||
| 41 | * @param int $page |
||
| 42 | * @param int $limit |
||
| 43 | * @param int $total |
||
| 44 | * @param ResourceInterface ...$resources |
||
| 45 | */ |
||
| 46 | 3 | public function __construct(int $page, int $limit, int $total, ResourceInterface ...$resources) |
|
| 54 | |||
| 55 | /** |
||
| 56 | * Get page |
||
| 57 | * |
||
| 58 | * @return int |
||
| 59 | */ |
||
| 60 | 3 | public function getPage(): int |
|
| 64 | |||
| 65 | /** |
||
| 66 | * Get limit |
||
| 67 | * |
||
| 68 | * @return int |
||
| 69 | */ |
||
| 70 | 3 | public function getLimit(): int |
|
| 74 | |||
| 75 | /** |
||
| 76 | * Get the count of total items |
||
| 77 | * |
||
| 78 | * @return int |
||
| 79 | */ |
||
| 80 | 3 | public function getTotal(): int |
|
| 84 | } |
||
| 85 |