Total Complexity | 6 |
Total Lines | 58 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
9 | class Paginator extends BasePaginator |
||
10 | { |
||
11 | /** |
||
12 | * @var IdiormDbal |
||
13 | */ |
||
14 | private $dbal; |
||
15 | |||
16 | /** |
||
17 | * @var array|IdiormResultSet |
||
18 | */ |
||
19 | public $data; |
||
20 | |||
21 | /** |
||
22 | * @param $idiormDbal |
||
23 | * @param int $perPage |
||
24 | * @param int $page |
||
25 | * @throws DatabaseException |
||
26 | */ |
||
27 | public function __construct($idiormDbal, int $perPage, int $page = 1) |
||
37 | } |
||
38 | |||
39 | /** |
||
40 | * @return mixed |
||
41 | */ |
||
42 | public function firstItem() |
||
43 | { |
||
44 | if (!is_array($this->data)){ |
||
45 | $this->data = $this->data->as_array(); |
||
46 | } |
||
47 | return $this->data[array_key_first($this->data)]; |
||
48 | } |
||
49 | |||
50 | /** |
||
51 | * @return mixed |
||
52 | */ |
||
53 | public function lastItem() |
||
59 | } |
||
60 | |||
61 | /** |
||
62 | * @return array|IdiormResultSet |
||
63 | */ |
||
64 | public function data() |
||
67 | } |
||
68 | } |