Open Monograph Press  1.1
 All Classes Namespaces Functions Variables Groups Pages
FormValidatorArray Class Reference
Inheritance diagram for FormValidatorArray:
FormValidator

Public Member Functions

 FormValidatorArray (&$form, $field, $type, $message, $fields=array())
 
 getErrorFields ()
 
 isValid ()
 
- Public Member Functions inherited from FormValidator
 FormValidator (&$form, $field, $type, $message, $validator=null)
 
 getField ()
 
 getFieldValue ()
 
getForm ()
 
 getMessage ()
 
 getType ()
 
getValidator ()
 
 isEmptyAndOptional ()
 
 isValid ()
 

Public Attributes

 $_errorFields
 
 $_fields
 
- Public Attributes inherited from FormValidator
 $_field
 
 $_form
 
 $_message
 
 $_type
 
 $_validator
 

Detailed Description

Form validation check that checks an array of fields.

Definition at line 18 of file FormValidatorArray.inc.php.

Member Function Documentation

FormValidatorArray::FormValidatorArray ( $form,
  $field,
  $type,
  $message,
  $fields = array() 
)

Constructor.

Parameters
$formForm the associated form
$fieldstring the name of the associated field
$typestring the type of check, either "required" or "optional"
$messagestring the error message for validation failures (i18n key)
$fieldsarray all subfields for each item in the array, i.e. name[][foo]. If empty it is assumed that name[] is a data field

Definition at line 40 of file FormValidatorArray.inc.php.

References $_errorFields.

FormValidatorArray::getErrorFields ( )

Get array of fields where an error occurred.

Returns
array

Definition at line 54 of file FormValidatorArray.inc.php.

References FormValidator\getFieldValue(), and FormValidator\getType().

FormValidatorArray::isValid ( )
See Also
FormValidator::isValid() Value is valid if it is empty and optional or all field values are set.
Returns
boolean

Definition at line 67 of file FormValidatorArray.inc.php.

References FormValidator\getField().

Member Data Documentation

array FormValidatorArray::$_errorFields

Array of field names where an error occurred

Definition at line 30 of file FormValidatorArray.inc.php.

Referenced by FormValidatorArray().

array FormValidatorArray::$_fields

Array of fields to check

Definition at line 24 of file FormValidatorArray.inc.php.


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