Conditions | 4 |
Paths | 3 |
Total Lines | 17 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
24 | public function updateItemEditForm($form) |
||
25 | { |
||
26 | $list = $this->owner->gridField->getList(); |
||
27 | if ($list && $list instanceof HasManyList) { |
||
28 | $foreignKey = $list->getForeignKey(); |
||
29 | $dataClass = $list->dataClass(); |
||
30 | $dataQuery = $list->dataQuery(); |
||
31 | $foreignID = $list->getForeignID(); |
||
32 | $fields = $form->Fields(); |
||
33 | $field = $fields->dataFieldByName($foreignKey); |
||
34 | if ($field) { |
||
35 | $field->setValue($foreignID); |
||
36 | $fields->replaceField($field->Name, $field->performDisabledTransformation()); |
||
37 | } |
||
38 | $this->owner->record->$foreignKey = $foreignID; |
||
39 | } |
||
40 | } |
||
41 | } |
||
42 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.