Total Complexity | 4 |
Total Lines | 35 |
Duplicated Lines | 0 % |
Coverage | 0% |
Changes | 0 |
1 | <?php |
||
6 | trait DbalPaginatorCapabilities |
||
7 | { |
||
8 | protected function findAll(): array |
||
9 | { |
||
10 | $this->qb |
||
|
|||
11 | ->setMaxResults($this->limit) |
||
12 | ->setFirstResult($this->offset); |
||
13 | |||
14 | return $this->qb->execute()->fetchAll(); |
||
15 | } |
||
16 | |||
17 | protected function getTotal(): int |
||
18 | { |
||
19 | $qb = clone $this->qb; |
||
20 | $countFrom = $this->getCountFrom(); |
||
21 | |||
22 | $qb->select("COUNT($countFrom)") |
||
23 | ->setMaxResults(null) |
||
24 | ->setFirstResult(null) |
||
25 | ->resetQueryPart('orderBy'); |
||
26 | |||
27 | return (int) $qb->execute()->fetchColumn(); |
||
28 | } |
||
29 | |||
30 | protected function getCountFrom(): string |
||
41 | } |
||
42 | } |
||
43 |