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