| Conditions | 4 |
| Paths | 8 |
| Total Lines | 18 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 9 | public function paginatedList(HTTPRequest $request = null) |
||
|
|
|||
| 10 | { |
||
| 11 | if ($request === null) { |
||
| 12 | $request = $this->request; |
||
| 13 | } |
||
| 14 | $start = ($request->getVar('start')) ? (int) $request->getVar('start') : 0; |
||
| 15 | |||
| 16 | $records = PaginatedList::create($this->data()->Children(), $request); |
||
| 17 | $records->setPageStart($start); |
||
| 18 | |||
| 19 | if ($limit = $this->data()->PerPage) { |
||
| 20 | $records->setPageLength($limit); |
||
| 21 | } |
||
| 22 | |||
| 23 | // allow $records to be updated via extension |
||
| 24 | $this->owner->extend('updatePaginatedList', $records); |
||
| 25 | |||
| 26 | return $records; |
||
| 27 | } |
||
| 29 |