Conditions | 3 |
Paths | 3 |
Total Lines | 19 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
8 | public function getColumnContent($gridField, $record, $columnName) { |
||
9 | if(!$record->canEdit()) return; |
||
10 | |||
11 | $field = new CompositeField(); |
||
12 | |||
13 | if(!$record instanceof ElementVirtualLinked) { |
||
14 | $field = GridField_FormAction::create($gridField, |
||
15 | 'UnlinkRelation'.$record->ID, |
||
16 | false, |
||
17 | 'unlinkrelation', |
||
18 | array('RecordID' => $record->ID) |
||
19 | ) |
||
20 | ->addExtraClass('gridfield-button-unlink') |
||
21 | ->setAttribute('title', _t('GridAction.UnlinkRelation', "Unlink")) |
||
22 | ->setAttribute('data-icon', 'chain--minus'); |
||
23 | } |
||
24 | |||
25 | return $field->Field(); |
||
26 | } |
||
27 | } |
||
28 |
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.