Conditions | 3 |
Paths | 2 |
Total Lines | 18 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
30 | 2 | public function paginateResults ( |
|
31 | QueryBuilderOptions $queryOptions, |
||
32 | DoctrineORMAdapter $ormAdapter, |
||
33 | PagerfantaBuilder $pagerfantaBuilder, |
||
34 | $routeName, |
||
35 | $useResultCache |
||
36 | ) { |
||
37 | 2 | $limit = $queryOptions->get('limit', self::LIMIT); |
|
38 | 2 | $page = $queryOptions->get('page', self::PAGE); |
|
39 | |||
40 | 2 | $query = $ormAdapter->getQuery(); |
|
41 | 2 | if (isset($useResultCache) && $useResultCache) { |
|
42 | 1 | $query->useResultCache(true, self::LIFETIME); |
|
43 | } |
||
44 | |||
45 | 2 | $route = $this->router->createRouter($queryOptions, $routeName); |
|
46 | |||
47 | 2 | return $pagerfantaBuilder->createRepresentation($route, $limit, $page); |
|
48 | } |
||
49 | } |