Method Summary
-
Boolean
call($event)
Adds 1.0 compatibility methods to the request object.
-
string
getError($request, $name)
Retrieves an error message.
-
array
getErrorNames($request)
Retrieves an array of error names.
-
array
getErrors($request)
Retrieves an array of errors.
-
array
getFile($request, $name)
Retrieves an array of file information.
-
int
getFileError($request, $name)
Retrieves a file error.
-
string
getFileExtension($request, $name)
Retrieves an extension for a given file.
-
string
getFileName($request, $name)
Retrieves a file name.
-
array
getFileNames($request)
Retrieves an array of file names.
-
string
getFilePath($request, $name)
Retrieves a file path.
-
int
getFileSize($request, $name)
Retrieve a file size.
-
string
getFileType($request, $name)
Retrieves a file type.
-
string
getFileValue($request, $name, $key)
Retrieves a file value.
-
array
getFileValues($request, $name)
Retrieves all the values from a file.
-
bool
hasError($request, $name)
Indicates whether or not an error exists.
-
bool
hasErrors($request)
Indicates whether or not any errors exist.
-
bool
hasFile($request, $name)
Indicates whether or not a file exists.
-
bool
hasFileError($request, $name)
Indicates whether or not a file error exists.
-
bool
hasFileErrors($request)
Indicates whether or not any file errors occured.
-
boolean
hasFiles($request)
Indicates whether or not any files exist.
-
bool
moveFile($request, $name, $file, $fileMode, $create, $dirMode)
Moves an uploaded file.
-
string
removeError($request, $name)
Removes an error.
-
setError($request, $name, $message)
Sets an error.
-
setErrors($request, $erros)
Sets an array of errors
Method Details
-
(Boolean) call ($event)
Browse code
Adds 1.0 compatibility methods to the request object.
returns true if the method has been found here, false otherwise
-
(string) getError ($request, $name)
Browse code
| $request |
A request object |
| $name |
An error name |
Retrieves an error message.
returns An error message, if the error exists, otherwise null
-
(array) getErrorNames ($request)
Browse code
| $request |
A request object |
Retrieves an array of error names.
returns An indexed array of error names
-
(array) getErrors ($request)
Browse code
| $request |
A request object |
Retrieves an array of errors.
returns An associative array of errors
-
(array) getFile ($request, $name)
Browse code
| $request |
A request object |
| $name |
A file name |
Retrieves an array of file information.
returns An associative array of file information, if the file exists, otherwise null
-
(int) getFileError ($request, $name)
Browse code
| $request |
A request object |
| $name |
A file name |
Retrieves a file error.
returns One of the following error codes: - UPLOAD_ERR_OK (no error) - UPLOAD_ERR_INI_SIZE (the uploaded file exceeds the upload_max_filesize directive in php.ini) - UPLOAD_ERR_FORM_SIZE (the uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form) - UPLOAD_ERR_PARTIAL (the uploaded file was only partially uploaded) - UPLOAD_ERR_NO_FILE (no file was uploaded)
-
(string) getFileExtension ($request, $name)
Browse code
| $request |
A request object |
| $name |
A file name |
Retrieves an extension for a given file.
returns Extension for the file
-
(string) getFileName ($request, $name)
Browse code
| $request |
A request object |
| $name |
A file nam. |
Retrieves a file name.
returns A file name, if the file exists, otherwise null
-
(array) getFileNames ($request)
Browse code
| $request |
A request object |
Retrieves an array of file names.
returns An indexed array of file names
-
(string) getFilePath ($request, $name)
Browse code
| $request |
A request object |
| $name |
A file name |
Retrieves a file path.
returns A file path, if the file exists, otherwise null
-
(int) getFileSize ($request, $name)
Browse code
| $request |
A request object |
| $name |
A file name |
Retrieve a file size.
returns A file size, if the file exists, otherwise null
-
(string) getFileType ($request, $name)
Browse code
| $request |
A request object |
| $name |
A file name |
Retrieves a file type.
This may not be accurate. This is the mime-type sent by the browser
during the upload.
returns A file type, if the file exists, otherwise null
-
(string) getFileValue ($request, $name, $key)
Browse code
| $request |
A request object |
| $name |
A file name |
| $key |
Value to search in the file |
Retrieves a file value.
returns File value
-
(array) getFileValues ($request, $name)
Browse code
| $request |
A request object |
| $name |
A file name |
Retrieves all the values from a file.
returns Associative list of the file values
-
(bool) hasError ($request, $name)
Browse code
| $request |
A request object |
| $name |
An error name |
Indicates whether or not an error exists.
returns true, if the error exists, otherwise false
-
(bool) hasErrors ($request)
Browse code
| $request |
A request object |
Indicates whether or not any errors exist.
returns true, if any error exist, otherwise false
-
(bool) hasFile ($request, $name)
Browse code
| $request |
A request object |
| $name |
A file name |
Indicates whether or not a file exists.
returns true, if the file exists, otherwise false
-
(bool) hasFileError ($request, $name)
Browse code
| $request |
A request object |
| $name |
A file name |
Indicates whether or not a file error exists.
returns true, if the file error exists, otherwise false
-
(bool) hasFileErrors ($request)
Browse code
| $request |
A request object |
Indicates whether or not any file errors occured.
returns true, if any file errors occured, otherwise false
-
(boolean) hasFiles ($request)
Browse code
| $request |
A request object |
Indicates whether or not any files exist.
returns true, if any files exist, otherwise false
-
(bool) moveFile ($request, $name, $file, $fileMode, $create, $dirMode)
Browse code
| $request |
A request object |
| $name |
A file name |
| $file |
An absolute filesystem path to where you would like the file moved. This includes the new filename as well, since uploaded files are stored with random names |
| $fileMode |
The octal mode to use for the new file |
| $create |
Indicates that we should make the directory before moving the file |
| $dirMode |
The octal mode to use when creating the directory |
Moves an uploaded file.
returns true, if the file was moved, otherwise false
throws sfFileException If a major error occurs while attempting to move the file
-
(string) removeError ($request, $name)
Browse code
| $request |
A request object |
| $name |
An error name |
Removes an error.
returns An error message, if the error was removed, otherwise null
-
setError ($request, $name, $message)
Browse code
| $request |
A request object |
| $name |
An error name |
| $message |
An error message |
Sets an error.
-
setErrors ($request, $erros)
Browse code
| $request |
A request object |
| $erros |
An associative array of errors and their associated messages |
Sets an array of errors
If an existing error name matches any of the keys in the supplied
array, the associated message will be overridden.
|