Conditions | 2 |
Paths | 5 |
Total Lines | 13 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
33 | public function addPagination($offset, $length) |
||
34 | { |
||
35 | try { |
||
36 | $parameters = $this->getParameters(); |
||
37 | $parameters->setPage((int) (ceil($offset / $length) + 1)); |
||
38 | $parameters->setMaxResults((int) $length); |
||
39 | $this->setParameters($parameters); |
||
40 | } catch (InvalidArgumentException $e) { |
||
41 | throw new RequestException('Could not set pagination parameters.'); |
||
42 | } |
||
43 | |||
44 | return $this; |
||
45 | } |
||
46 | } |
||
47 |