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

Public Member Functions

 FormValidatorArrayCustom (&$form, $field, $type, $message, $userFunction, $additionalArguments=array(), $complementReturn=false, $fields=array(), $isLocaleField=false)
 
 getErrorFields ()
 
 isArray ()
 
 isLocaleField ()
 
 isValid ()
 
- Public Member Functions inherited from FormValidator
 FormValidator (&$form, $field, $type, $message, $validator=null)
 
 getField ()
 
 getFieldValue ()
 
getForm ()
 
 getMessage ()
 
 getType ()
 
getValidator ()
 
 isEmptyAndOptional ()
 
 isValid ()
 

Public Attributes

 $_additionalArguments
 
 $_complementReturn
 
 $_errorFields
 
 $_fields
 
 $_isLocaleField
 
 $_userFunction
 
- Public Attributes inherited from FormValidator
 $_field
 
 $_form
 
 $_message
 
 $_type
 
 $_validator
 

Detailed Description

Form validation check with a custom user function performing the validation check of an array of fields.

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

Member Function Documentation

FormValidatorArrayCustom::FormValidatorArrayCustom ( $form,
  $field,
  $type,
  $message,
  $userFunction,
  $additionalArguments = array(),
  $complementReturn = false,
  $fields = array(),
  $isLocaleField = false 
)

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)
$userFunctionfunction the user function to use for validation
$additionalArgumentsarray optional, a list of additional arguments to pass to $userFunction
$complementReturnboolean optional, complement the value returned by $userFunction
$fieldsarray all subfields for each item in the array, i.e. name[][foo]. If empty it is assumed that name[] is a data field
$isLocaleFieldboolean

Definition at line 68 of file FormValidatorArrayCustom.inc.php.

FormValidatorArrayCustom::getErrorFields ( )

Get array of fields where an error occurred.

Returns
array

Definition at line 85 of file FormValidatorArrayCustom.inc.php.

FormValidatorArrayCustom::isArray ( )

Is the field an array.

Returns
boolean

Definition at line 178 of file FormValidatorArrayCustom.inc.php.

FormValidatorArrayCustom::isLocaleField ( )

Is it a multilingual-capable field.

Returns
boolean

Definition at line 93 of file FormValidatorArrayCustom.inc.php.

References FormValidator\getType().

Referenced by isValid().

FormValidatorArrayCustom::isValid ( )
See Also
FormValidator::isValid()
Returns
boolean

Definition at line 105 of file FormValidatorArrayCustom.inc.php.

References FormValidator\getField(), and isLocaleField().

Member Data Documentation

array FormValidatorArrayCustom::$_additionalArguments

Additional arguments to pass to $userFunction

Definition at line 48 of file FormValidatorArrayCustom.inc.php.

boolean FormValidatorArrayCustom::$_complementReturn

If true, field is considered valid if user function returns false instead of true

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

array FormValidatorArrayCustom::$_errorFields

Array of field names where an error occurred

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

array FormValidatorArrayCustom::$_fields

Array of fields to check

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

boolean FormValidatorArrayCustom::$_isLocaleField

is the field a multilingual-capable field

Definition at line 36 of file FormValidatorArrayCustom.inc.php.

callable FormValidatorArrayCustom::$_userFunction

Custom validation function

Definition at line 42 of file FormValidatorArrayCustom.inc.php.


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