Conditions | 4 |
Paths | 8 |
Total Lines | 21 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
14 | public function paginatedList(HTTPRequest $request = null) |
||
15 | { |
||
16 | if (!$request instanceof HTTPRequest) { |
||
17 | $request = $this->getRequest(); |
||
18 | } |
||
19 | |||
20 | $recipes = $this->data()->getRecipeList(); |
||
21 | |||
22 | $start = ($request->getVar('start')) ? (int)$request->getVar('start') : 0; |
||
23 | |||
24 | $records = PaginatedList::create($recipes, $request); |
||
25 | $records->setPageStart($start); |
||
26 | |||
27 | if ($limit = $this->data()->RecipesPerPage) { |
||
28 | $records->setPageLength($limit); |
||
29 | } |
||
30 | |||
31 | // allow $records to be updated via extension |
||
32 | $this->extend('updatePaginatedList', $records); |
||
33 | |||
34 | return $records; |
||
35 | } |
||
37 |