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

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

- Public Attributes inherited from FormValidator

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

Member Function Documentation

FormValidatorArrayCustom::FormValidatorArrayCustom ( $form,
  $additionalArguments = array(),
  $complementReturn = false,
  $fields = array(),
  $isLocaleField = false 


$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

Definition at line 68 of file

FormValidatorArrayCustom::getErrorFields ( )

Get array of fields where an error occurred.


Definition at line 85 of file

FormValidatorArrayCustom::isArray ( )

Is the field an array.


Definition at line 178 of file

FormValidatorArrayCustom::isLocaleField ( )

Is it a multilingual-capable field.


Definition at line 93 of file

References FormValidator\getType().

Referenced by isValid().

FormValidatorArrayCustom::isValid ( )
See Also

Definition at line 105 of file

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

Member Data Documentation

array FormValidatorArrayCustom::$_additionalArguments

Additional arguments to pass to $userFunction

Definition at line 48 of file

boolean FormValidatorArrayCustom::$_complementReturn

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

Definition at line 54 of file

array FormValidatorArrayCustom::$_errorFields

Array of field names where an error occurred

Definition at line 30 of file

array FormValidatorArrayCustom::$_fields

Array of fields to check

Definition at line 24 of file

boolean FormValidatorArrayCustom::$_isLocaleField

is the field a multilingual-capable field

Definition at line 36 of file

callable FormValidatorArrayCustom::$_userFunction

Custom validation function

Definition at line 42 of file

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