Conditions | 2 |
Paths | 2 |
Total Lines | 15 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
13 | public function updateCMSFields(FieldList $fields) |
||
14 | { |
||
15 | $fields->removeByName('NutriHolderID'); |
||
16 | if ($this->owner->NutriHolder()->exists()) { |
||
17 | $fields->addFieldsToTab( |
||
18 | 'Root.Nutrition', |
||
19 | array( |
||
20 | HasOneButtonField::create('NutriHolder', 'Nutritional Info', $this->owner), |
||
21 | HeaderField::create('SelectNutriHolderHeader', 'Select existing Nutritional Information Profile'), |
||
22 | DropDownField::create('NutriHolderID', 'Nutritional Info', array("" => "-- please select --") + NutriHolder::get()->map()->toArray()) |
||
23 | ->setRightTitle('Select an existing Nutritional Information Profile'), |
||
24 | ) |
||
25 | ); |
||
26 | } |
||
27 | } |
||
28 | } |
||
29 |
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.