1 | <?php |
||
8 | class EditableFileField extends EditableFormField |
||
|
|||
9 | { |
||
10 | |||
11 | private static $singular_name = 'File Upload Field'; |
||
12 | |||
13 | private static $plural_names = 'File Fields'; |
||
14 | |||
15 | private static $db = array( |
||
16 | 'MaxFileSizeMB' => 'Float', |
||
17 | ); |
||
18 | |||
19 | private static $has_one = array( |
||
20 | 'Folder' => 'Folder' // From CustomFields |
||
21 | ); |
||
22 | |||
23 | /** |
||
24 | * Further limit uploadable file extensions in addition to the restrictions |
||
25 | * imposed by the File.allowed_extensions global configuration. |
||
26 | * @config |
||
27 | */ |
||
28 | private static $allowed_extensions_blacklist = array( |
||
29 | 'htm', 'html', 'xhtml', 'swf', 'xml' |
||
30 | ); |
||
31 | |||
32 | /** |
||
33 | * @return FieldList |
||
34 | */ |
||
35 | public function getCMSFields() |
||
62 | |||
63 | /** |
||
64 | * @return ValidationResult |
||
65 | */ |
||
66 | 4 | public function validate() |
|
77 | |||
78 | 4 | public function getFormField() |
|
112 | |||
113 | |||
114 | /** |
||
115 | * Return the value for the database, link to the file is stored as a |
||
116 | * relation so value for the field can be null. |
||
117 | * |
||
118 | * @return string |
||
119 | */ |
||
120 | public function getValueFromData() |
||
124 | |||
125 | public function getSubmittedFormField() |
||
129 | |||
130 | |||
131 | 2 | public function migrateSettings($data) |
|
141 | |||
142 | /** |
||
143 | * @return float |
||
144 | */ |
||
145 | 7 | public static function get_php_max_file_size() |
|
151 | |||
152 | 1 | public function getPHPMaxFileSizeMB() |
|
156 | |||
157 | } |
||
158 |
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.