Conditions | 4 |
Paths | 3 |
Total Lines | 12 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
30 | public function onBeforeDuplicate($original, $doWrite=true) |
||
31 | { |
||
32 | $thisClass = $this->owner->ClassName; |
||
33 | $clearRelations = Config::inst()->get($thisClass, 'duplicate_clear_relations'); |
||
34 | |||
35 | if ($clearRelations && !empty($clearRelations)) { |
||
36 | foreach ($clearRelations as $clearRelation) { |
||
37 | $clearRelation = $clearRelation . 'ID'; |
||
38 | $this->owner->$clearRelation = 0; |
||
39 | } |
||
40 | } |
||
41 | } |
||
42 | } |
||
43 |
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.