Conditions | 4 |
Paths | 5 |
Total Lines | 20 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 20 |
Changes | 0 |
1 | <?php declare(strict_types=1); |
||
29 | protected function prepareModels() |
||
30 | { |
||
31 | $limit = 0; |
||
32 | $offset = 0; |
||
33 | $orderBy = []; |
||
34 | |||
35 | if (($pagination = $this->getPagination()) !== false) { |
||
36 | $pagination->totalCount = $this->getTotalCount(); |
||
37 | if ($pagination->totalCount === 0) { |
||
38 | return []; |
||
39 | } |
||
40 | $limit = $pagination->getLimit(); |
||
41 | $offset = $pagination->getOffset(); |
||
42 | } |
||
43 | if (($sort = $this->getSort()) !== false) { |
||
44 | $orderBy = $sort->getOrders(); |
||
45 | } |
||
46 | |||
47 | return $this->repository->findAll($this->conditions, $orderBy, $limit, $offset, $this->with); |
||
48 | } |
||
49 | |||
55 |