1 | <?php |
||
16 | class Pager |
||
17 | { |
||
18 | /** |
||
19 | * Decorator. |
||
20 | * |
||
21 | * @var AttributeDecoratorInterface |
||
22 | */ |
||
23 | protected $decorator; |
||
24 | |||
25 | /** |
||
26 | * Data. |
||
27 | * |
||
28 | * @var iterable |
||
29 | */ |
||
30 | protected $data; |
||
31 | |||
32 | /** |
||
33 | * Attributes. |
||
34 | * |
||
35 | * @var array |
||
36 | */ |
||
37 | protected $attributes; |
||
38 | |||
39 | /** |
||
40 | * Offset. |
||
41 | * |
||
42 | * @var int |
||
43 | */ |
||
44 | protected $offset; |
||
45 | |||
46 | /** |
||
47 | * Limit. |
||
48 | * |
||
49 | * @var int |
||
50 | */ |
||
51 | protected $limit; |
||
52 | |||
53 | /** |
||
54 | * Total. |
||
55 | * |
||
56 | * @var int |
||
57 | */ |
||
58 | protected $total; |
||
59 | |||
60 | /** |
||
61 | * URI. |
||
62 | * |
||
63 | * @var string |
||
64 | */ |
||
65 | protected $uri; |
||
66 | |||
67 | /** |
||
68 | * Init. |
||
69 | * |
||
70 | * @param AttributeDecoratorInterface $decorator |
||
71 | * @param iterable $data |
||
72 | * @param array $attributes |
||
73 | * @param int $offset |
||
74 | * @param int $limit |
||
75 | * @param string $uri |
||
76 | * @param int $total |
||
77 | */ |
||
78 | public function __construct(AttributeDecoratorInterface $decorator, Iterable $data, array $attributes, int $offset, int $limit, string $uri, ?int $total = null) |
||
88 | |||
89 | /** |
||
90 | * Pagin. |
||
91 | * |
||
92 | * @return array |
||
93 | */ |
||
94 | public function paging(): array |
||
117 | |||
118 | /** |
||
119 | * Get paging links. |
||
120 | * |
||
121 | * @param int $count |
||
122 | * |
||
123 | * @return array |
||
124 | */ |
||
125 | protected function getLinks(int $count): array |
||
150 | } |
||
151 |