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