1 | <?php |
||
10 | class EditableCheckbox extends EditableFormField |
||
|
|||
11 | { |
||
12 | |||
13 | private static $singular_name = 'Checkbox Field'; |
||
14 | |||
15 | private static $plural_name = 'Checkboxes'; |
||
16 | |||
17 | protected $jsEventHandler = 'click'; |
||
18 | |||
19 | private static $db = array( |
||
20 | 'CheckedDefault' => 'Boolean' // from CustomSettings |
||
21 | ); |
||
22 | |||
23 | /** |
||
24 | * @return FieldList |
||
25 | */ |
||
26 | public function getCMSFields() |
||
37 | |||
38 | public function getFormField() |
||
48 | |||
49 | public function getValueFromData($data) |
||
50 | { |
||
51 | $value = (isset($data[$this->Name])) ? $data[$this->Name] : false; |
||
52 | |||
53 | return ($value) ? _t('EditableFormField.YES', 'Yes') : _t('EditableFormField.NO', 'No'); |
||
54 | } |
||
55 | |||
56 | 2 | public function migrateSettings($data) |
|
66 | |||
67 | public function isCheckBoxField() { |
||
70 | } |
||
71 |
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.