Public Member Functions | Static Public Member Functions | Data Fields
UploadFileException Class Reference

Thrown when a file upload did not succeed for the reason present within the thrown exception.. More...

Inheritance diagram for UploadFileException:

Public Member Functions

 UploadFileException ($message_code, $field_name=null, $required_value= '', $code=0, Exception $previous=null)
 
 getFieldName ()
 

Static Public Member Functions

static generateMessage ($message_code, $field_name= '', $required_value= '')
 

Data Fields

 $messages
 
 $field_name
 

Detailed Description

Thrown when a file upload did not succeed for the reason present within the thrown exception..

Version
1.1
Author
DinuSV

Member Function Documentation

UploadFileException (   $message_code,
  $field_name = null,
  $required_value = '',
  $code = 0,
Exception  $previous = null 
)

Constructor

Parameters
$message_codestring : [optional] message to output
$field_namestring : [optional] name of the field the exception was thrown for
$required_valuestring : [optional]
$previousException : [optional]
$codeint : [optional]
See Also
php exception
static generateMessage (   $message_code,
  $field_name = '',
  $required_value = '' 
)
static

Generates form validation message according to the messagecode given

Parameters
$message_codestring : code for the message
$field_namestring : [optional] name of the field the exception was thrown for
$required_valuestring : [optional] value required for the field
Returns
string
getFieldName ( )

Get the field the exception was trown for

Returns
string

Field Documentation

$messages
Initial value:
= array(
FileUpload::INI_MAX_SIZE => 'File exceeds the maximum size',
FileUpload::FORM_MAX_SIZE => 'File exceeds the maximum size supported by the form',
FileUpload::INCOMPLETE => 'File was not fully uploaded. Please try uploading the file again',
FileUpload::REQUIRED => 'No file specified at %name',
FileUpload::MAX_SIZE => 'File exceeds %required',
FileUpload::MIN_SIZE => 'File is smaller than %required',
FileUpload::TYPE => 'File must be of type %required',
FileUpload::UNKNOWN => 'There was a problem uploading the file'
)

array : map of upload-error-types and their messages

$field_name

string : Name of the field the exception was thrown for