| Conditions | 4 |
| Paths | 4 |
| Total Lines | 23 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 30 | public function getManipulatedData(GridField $gridField, SS_List $dataList) |
||
| 31 | { |
||
| 32 | |||
| 33 | if(!$gridField->State->GridFieldAddRelation) { |
||
| 34 | return $dataList; |
||
| 35 | } |
||
| 36 | $objectID = Convert::raw2sql($gridField->State->GridFieldAddRelation); |
||
| 37 | if($objectID) { |
||
| 38 | $object = DataObject::get_by_id($dataList->dataclass(), $objectID); |
||
| 39 | |||
| 40 | if($object) { |
||
| 41 | $virtual = new ElementVirtualLinked(); |
||
| 42 | $virtual->LinkedElementID = $object->ID; |
||
| 43 | $virtual->write(); |
||
| 44 | |||
| 45 | $dataList->add($virtual); |
||
| 46 | } |
||
| 47 | } |
||
| 48 | |||
| 49 | $gridField->State->GridFieldAddRelation = null; |
||
| 50 | |||
| 51 | return $dataList; |
||
| 52 | } |
||
| 53 | } |
||
| 54 |
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.