Total Complexity | 6 |
Total Lines | 49 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
5 | abstract class NestedModuleController extends ModuleController |
||
6 | { |
||
7 | /** |
||
8 | * Indicates if only parent items should be displayed when browsing for this module |
||
9 | * within a browser field. |
||
10 | * |
||
11 | * @var bool |
||
12 | */ |
||
13 | protected $showOnlyParentItemsInBrowsers = true; |
||
14 | |||
15 | /** |
||
16 | * The maximum depth allowed for nested items. A value of `1` means parent & child. |
||
17 | * |
||
18 | * @var int |
||
19 | */ |
||
20 | protected $nestedItemsDepth = 1; |
||
21 | |||
22 | protected function indexData($request) |
||
23 | { |
||
24 | return [ |
||
25 | 'nested' => true, |
||
26 | 'nestedDepth' => $this->nestedItemsDepth, |
||
27 | ]; |
||
28 | } |
||
29 | |||
30 | protected function transformIndexItems($items) |
||
33 | } |
||
34 | |||
35 | protected function indexItemData($item) |
||
36 | { |
||
37 | return ($item->children ? [ |
||
38 | 'children' => $this->getIndexTableData($item->children), |
||
39 | ] : []); |
||
40 | } |
||
41 | |||
42 | protected function getBrowserItems($scopes = []) |
||
54 | ); |
||
55 | } |
||
57 |