Loading Please wait...

zRom_upload Class Reference
[Request Object Model.File Upload]

Works as a container of File Upload. More...

Inheritance diagram for zRom_upload:

Inheritance graph
[legend]
Collaboration diagram for zRom_upload:

Collaboration graph
[legend]

Public Member Functions

 zRom_upload ($method=null)
 __construct ($method=null)
 initValidator ($map_file)
 Initilizes the validation System.
 valueOf ($fieldName, $strict=false)
 Works same as zRom_form::valueOf() however only applicable to File Upload.
 isSubmitted ()
 Checks wheather or not form has been submitted.

Data Fields

 $items = array()
 $isValid = true
 $is_submited = false
 $frm_method

Detailed Description

Works as a container of File Upload.

$request->file is actually an Instance of zRom_upload Class. This class works like a Container or all File Upload Field(s). actually There is a composition relation between zRom_fields and zRom_form cause all fields are contained into zRom_form as a zRom_fields object

Definition at line 265 of file map.php.


Constructor & Destructor Documentation

zRom_upload::__construct ( method = null  ) 

Definition at line 287 of file map.php.

00287                                       {
00288     parent::__construct($method);
00289     //{ Make the $items array
00290     if(count($_FILES) >= 1){
00291       $this->items = $_FILES;
00292       $this->is_submited = true;
00293     }else{
00294       $this->is_submited = false;
00295     }
00296     //}
00297   }


Member Function Documentation

zRom_upload::zRom_upload ( method = null  ) 

Definition at line 284 of file map.php.

References upload::__construct().

00284                                     {
00285     $this->__construct($method);
00286   }

Here is the call graph for this function:

zRom_upload::initValidator ( map_file  ) 

Initilizes the validation System.

Validates the form by the provided Validation Map Name.

Parameters:
$map_file string Name of the Validation Map e.g. if the map Name is abcd.vld.map.php just specify ancd here

Definition at line 304 of file map.php.

References validationCore::$rules, zLogger::debug(), validationCore::errtext(), validationCore::isValid(), validationCore::parseCriteria(), and validationCore::validationStatus().

00304                                    {
00305     zLogger::debug("Initializing Validation(FILE) System reading ".$map_file, 'rom.validation');
00306     $this->isValid = false;
00307     $this->parseCriteria($map_file);
00308     $this->isValid = $this->isValid();
00309     foreach($this->rules as $field_name => $rules){
00310       //{ Make the $this->${field_names} = OBJECTS
00311       $field_name = str_replace(' ', '_', $field_name);//Replace all SPACE with _
00312       $errText =  $this->errtext($field_name);
00313       $this->{$field_name} =& new zRom_fields($this->items[$field_name], $errText, $this->isValid($field_name), $this->validationStatus($field_name));
00314       $validString = ($this->isValid($field_name)) ? "Valid" : "InValid";
00315       zLogger::debug("Storing Form Field: $field_name Value:$field_name as $validString ErrText: ".$errText, 'rom.Validation');
00316     }
00317   }

Here is the call graph for this function:

zRom_upload::valueOf ( fieldName,
strict = false 
)

Works same as zRom_form::valueOf() however only applicable to File Upload.

Parameters:
$fieldName string Name of the form Field thats value you want to retrive
$strict boolean if set to true returns boolean false if the form field doesn't exists
Returns:
mixed

Definition at line 325 of file map.php.

00325                                              {
00326     return isset($this->items[$fieldName]) ? $this->items[$fieldName] : ($strict ? false : "");
00327   }

zRom_upload::isSubmitted (  ) 

Checks wheather or not form has been submitted.

Returns boolean value wheather or not the form has been submitted. e.g. true if the form has been submitted else false

Returns:
boolean

Definition at line 335 of file map.php.

00335                         {
00336     return $this->is_submited;
00337   }


Field Documentation

zRom_upload::$items = array()

Definition at line 272 of file map.php.

zRom_upload::$isValid = true

Definition at line 280 of file map.php.

zRom_upload::$is_submited = false

Definition at line 281 of file map.php.

zRom_upload::$frm_method

Definition at line 282 of file map.php.


The documentation for this class was generated from the following file:

Generated on Mon Oct 27 23:54:28 2008 for zigmoyd.kdevelop by doxygen 1.5.6