1 | <?php |
||
9 | class File extends NamedElement |
||
10 | { |
||
11 | protected $type = 'file'; |
||
12 | |||
13 | protected $actionUrl; |
||
14 | |||
15 | protected $multiSelect = false; |
||
16 | |||
17 | protected $multiFile = true; |
||
18 | |||
19 | protected $showFileList = true; |
||
20 | |||
21 | protected $withCredentials = false; |
||
22 | |||
23 | protected $maxFileSize; |
||
24 | |||
25 | protected $fileUploadsLimit = 0; |
||
26 | |||
27 | protected $fileExtensions; |
||
28 | |||
29 | protected $listType = 'text'; |
||
30 | |||
31 | protected $disk; |
||
32 | |||
33 | /** |
||
34 | * @var string|\Closure|null |
||
35 | */ |
||
36 | protected $uploadPath; |
||
37 | |||
38 | /** |
||
39 | * @var \Closure|null |
||
40 | */ |
||
41 | protected $uploadFileNameRule; |
||
42 | |||
43 | public function getValue() |
||
58 | |||
59 | public function getActionUrl() |
||
78 | |||
79 | public function setActionUrl($value) |
||
85 | |||
86 | public function isMultiSelect() |
||
90 | |||
91 | public function enableMultiSelect() |
||
97 | |||
98 | /** |
||
99 | * Show file list |
||
100 | * |
||
101 | * @return $this |
||
102 | */ |
||
103 | public function disableFileList() |
||
109 | |||
110 | /** |
||
111 | * Indicates whether or not cross-site Access-Control requests |
||
112 | * should be made using credentials |
||
113 | * |
||
114 | * @return $this |
||
115 | */ |
||
116 | public function withCredentials() |
||
122 | |||
123 | /** |
||
124 | * The maximum size of an uploaded file in bytes |
||
125 | * If didn't set maximum size, return maximum size as configured in php.ini. |
||
126 | * |
||
127 | * @return int |
||
128 | */ |
||
129 | public function getMaxFileSize() |
||
136 | |||
137 | /** |
||
138 | * The maximum size allowed for an uploaded file in bytes |
||
139 | * |
||
140 | * @param int $value |
||
141 | * |
||
142 | * @return $this |
||
143 | */ |
||
144 | public function setMaxFileSize($value) |
||
150 | |||
151 | public function getFileExtensions() |
||
159 | |||
160 | /** |
||
161 | * A list of allowable extensions that can be uploaded. |
||
162 | * |
||
163 | * @param string $value |
||
164 | * |
||
165 | * @return $this |
||
166 | */ |
||
167 | public function setFileExtensions($value) |
||
173 | |||
174 | protected function getDefaultExtensions() |
||
178 | |||
179 | public function getFileUploadsLimit() |
||
183 | |||
184 | /** |
||
185 | * The maximum number of files that can be uploaded. |
||
186 | * |
||
187 | * @param int $value |
||
188 | * |
||
189 | * @return $this |
||
190 | */ |
||
191 | public function setFileUploadsLimit($value) |
||
197 | |||
198 | public function getListType() |
||
202 | |||
203 | public function toArray() |
||
215 | |||
216 | public function getDisk() |
||
224 | |||
225 | public function setDisk($value) |
||
231 | |||
232 | protected function getDefaultUploadPath(UploadedFile $file) |
||
236 | |||
237 | public function getUploadPath(UploadedFile $file) |
||
248 | |||
249 | /** |
||
250 | * The path of file save |
||
251 | * |
||
252 | * @param string|\Closure $value |
||
253 | * |
||
254 | * @return $this |
||
255 | */ |
||
256 | public function setUploadPath($value) |
||
262 | |||
263 | public function getUploadFileName(UploadedFile $file) |
||
271 | |||
272 | protected function getDefaultFileName(UploadedFile $file) |
||
277 | |||
278 | public function setUploadFileNameRule(\Closure $value) |
||
284 | |||
285 | public function saveFile(UploadedFile $file) |
||
298 | |||
299 | protected function prepareValue($value) |
||
306 | |||
307 | protected function existsFile($path) |
||
311 | |||
312 | protected function getFileUrl($path) |
||
316 | } |
||
317 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.