These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | |||
3 | class DMSDocumentCartAdmin extends ModelAdmin |
||
0 ignored issues
–
show
|
|||
4 | { |
||
5 | private static $managed_models = array( |
||
6 | 'DMSDocumentCartSubmission' |
||
7 | ); |
||
8 | |||
9 | private static $url_segment = 'cart'; |
||
0 ignored issues
–
show
|
|||
10 | private static $menu_title = 'Document Cart'; |
||
0 ignored issues
–
show
|
|||
11 | |||
12 | /** |
||
13 | * Remove ability to add new items in these grid fields |
||
14 | * |
||
15 | * @return CMSForm |
||
16 | */ |
||
17 | public function getEditForm($id = null, $fields = null) |
||
18 | { |
||
19 | /** @var CMSForm $form */ |
||
20 | $form = parent::getEditForm($id, $fields); |
||
21 | |||
22 | // See parent class |
||
23 | $gridFieldName = $this->sanitiseClassName($this->modelClass); |
||
24 | |||
25 | $gridFieldConfig = $form->Fields()->fieldByName($gridFieldName)->getConfig(); |
||
26 | $gridFieldConfig->removeComponentsByType('GridFieldAddNewButton'); |
||
27 | |||
28 | return $form; |
||
29 | } |
||
30 | } |
||
31 |
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.