| Total Complexity | 5 |
| Total Lines | 44 |
| Duplicated Lines | 0 % |
| Changes | 3 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 7 | class Collection extends BaseCollection |
||
| 8 | { |
||
| 9 | protected array $pagination = []; |
||
| 10 | |||
| 11 | /** |
||
| 12 | * Current page that the collection holds |
||
| 13 | */ |
||
| 14 | public function page(): ?int |
||
| 15 | { |
||
| 16 | return $this->pagination['page'] ?? null; |
||
| 17 | } |
||
| 18 | |||
| 19 | /** |
||
| 20 | * Number of avaliable pages |
||
| 21 | */ |
||
| 22 | public function pages(): ?int |
||
| 25 | } |
||
| 26 | |||
| 27 | /** |
||
| 28 | * Records per page |
||
| 29 | */ |
||
| 30 | public function pageSize(): ?int |
||
| 31 | { |
||
| 32 | return $this->pagination['pageSize'] ?? null; |
||
| 33 | } |
||
| 34 | |||
| 35 | /** |
||
| 36 | * Count of records avaliable in the the |
||
| 37 | */ |
||
| 38 | public function recordCount(): ?int |
||
| 39 | { |
||
| 40 | return $this->pagination['count'] ?? null; |
||
| 41 | } |
||
| 42 | |||
| 43 | /** |
||
| 44 | * Set pagination |
||
| 45 | */ |
||
| 46 | public function setPagination(?int $count = null, ?int $page = null, ?int $pageSize = null): self |
||
| 51 | } |
||
| 52 | } |
||
| 53 |