| 1 | <?php |
||
| 10 | class EditableEmailField extends EditableFormField |
||
|
|
|||
| 11 | { |
||
| 12 | |||
| 13 | private static $singular_name = 'Email Field'; |
||
| 14 | |||
| 15 | private static $plural_name = 'Email Fields'; |
||
| 16 | |||
| 17 | private static $has_placeholder = true; |
||
| 18 | |||
| 19 | public function getSetsOwnError() |
||
| 20 | { |
||
| 21 | return true; |
||
| 22 | } |
||
| 23 | |||
| 24 | public function getFormField() |
||
| 25 | { |
||
| 26 | $field = EmailField::create($this->Name, $this->EscapedTitle, $this->Default) |
||
| 27 | ->setFieldHolderTemplate('UserFormsField_holder') |
||
| 28 | ->setTemplate('UserFormsField'); |
||
| 29 | |||
| 30 | $this->doUpdateFormField($field); |
||
| 31 | |||
| 32 | return $field; |
||
| 33 | } |
||
| 34 | |||
| 35 | /** |
||
| 36 | * Updates a formfield with the additional metadata specified by this field |
||
| 37 | * |
||
| 38 | * @param FormField $field |
||
| 39 | */ |
||
| 40 | protected function updateFormField($field) |
||
| 46 | } |
||
| 47 |
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.