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 DMSGridFieldEditButton extends GridFieldEditButton |
||
0 ignored issues
–
show
|
|||
4 | { |
||
5 | /** |
||
6 | * Overriding the parent method to change the template that the DMS add button will be rendered with |
||
7 | * |
||
8 | * @param GridField $gridField |
||
9 | * @param DataObject $record |
||
10 | * @param string $columnName |
||
11 | * @return HTMLText |
||
12 | */ |
||
13 | public function getColumnContent($gridField, $record, $columnName) |
||
14 | { |
||
15 | $data = new ArrayData(array( |
||
16 | 'Link' => Controller::join_links($gridField->Link('item'), $record->ID, 'edit') |
||
17 | )); |
||
18 | $template = $record->canEdit() ? 'GridFieldEditButton' : 'GridFieldViewButton'; |
||
19 | return $data->renderWith($template); |
||
20 | } |
||
21 | } |
||
22 |
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.