Conditions | 3 |
Paths | 4 |
Total Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
26 | 2 | public function getRecordDefinition(Model $record): array |
|
27 | { |
||
28 | 2 | $definition = parent::getRecordDefinition($record); |
|
29 | |||
30 | 2 | if ($record instanceof SectionModel) { |
|
31 | 2 | $definition['entryTypes'] = Craft::$app->controller->module->modelMapper->export($record->getEntryTypes()); |
|
32 | } |
||
33 | |||
34 | 2 | if ($record instanceof Section_SiteSettings) { |
|
35 | 2 | unset($definition['attributes']['sectionId']); |
|
36 | 2 | unset($definition['attributes']['siteId']); |
|
37 | } |
||
38 | |||
39 | 2 | return $definition; |
|
40 | } |
||
41 | |||
68 |