Open Journal Systems  2.4.3
 All Classes Namespaces Functions Variables Groups Pages
FormValidatorCustom Class Reference
Inheritance diagram for FormValidatorCustom:
FormValidator

Public Member Functions

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

Detailed Description

Form validation check with a custom user function performing the validation check.

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

Member Function Documentation

FormValidatorCustom::FormValidatorCustom ( $form,
  $field,
  $type,
  $message,
  $userFunction,
  $additionalArguments = array(),
  $complementReturn = false 
)

Constructor. The user function is passed the form data as its first argument and $additionalArguments, if set, as the remaining arguments. This function must return a boolean value.

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)
$userFunctioncallable function 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

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

FormValidatorCustom::isValid ( )
See Also
FormValidator::isValid() Value is valid if it is empty and optional or validated by user-supplied function.
Returns
boolean

Definition at line 56 of file FormValidatorCustom.inc.php.

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


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