|
8 | 8 | use SolutionForest\InspireCms\Helpers\ContentHelper; |
9 | 9 | use SolutionForest\InspireCms\InspireCmsConfig; |
10 | 10 | use SolutionForest\InspireCms\Models\Contracts\Content; |
| 11 | +use SolutionForest\InspireCms\Support\TreeNode\Concerns\InteractsWithModelExplorer; |
| 12 | +use SolutionForest\InspireCms\Support\TreeNode\Contracts\HasModelExplorer; |
11 | 13 | use SolutionForest\InspireCms\Support\TreeNode\ModelExplorer; |
12 | | -use SolutionForest\InspireCms\Support\TreeNode\ModelExplorerComponent; |
| 14 | +use SolutionForest\InspireCms\Support\TreeNode\TreeComponent; |
13 | 15 |
|
14 | 16 | #[Lazy] |
15 | | -abstract class BaseContentTreeNode extends ModelExplorerComponent |
| 17 | +abstract class BaseContentTreeNode extends TreeComponent implements HasModelExplorer |
16 | 18 | { |
| 19 | + use InteractsWithModelExplorer { |
| 20 | + resolveSelectedModelItems as protected traitResolveSelectedModelItems; |
| 21 | + getGroupedNodeItems as protected traitGetGroupedNodeItems; |
| 22 | + } |
| 23 | + |
17 | 24 | public array $cachedModelExplorerRecords = []; |
18 | 25 |
|
19 | 26 | public bool $filterByPermission = true; |
@@ -65,7 +72,7 @@ public function modelExplorer(ModelExplorer $modelExplorer): ModelExplorer |
65 | 72 |
|
66 | 73 | public function getGroupedNodeItems() |
67 | 74 | { |
68 | | - $items = parent::getGroupedNodeItems(); |
| 75 | + $items = $this->traitGetGroupedNodeItems(); |
69 | 76 |
|
70 | 77 | if (! $this->filterByPermission) { |
71 | 78 | return $items; |
@@ -111,7 +118,7 @@ protected function resolveSelectedModelItems(...$keys) |
111 | 118 | ->filter(fn ($key) => (is_string($key) || is_int($key)) && $this->isValidSelectableModelItemKey($key)) |
112 | 119 | ->all(); |
113 | 120 |
|
114 | | - $recordsToCache = count($missingKeys) > 0 ? parent::resolveSelectedModelItems($missingKeys) : collect(); |
| 121 | + $recordsToCache = count($missingKeys) > 0 ? $this->traitResolveSelectedModelItems($missingKeys) : collect(); |
115 | 122 |
|
116 | 123 | if ($recordsToCache != null) { |
117 | 124 | foreach ($recordsToCache as $record) { |
|
0 commit comments