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

Public Member Functions

 FormValidatorLength (&$form, $field, $type, $message, $comparator, $length)
 
 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 that checks if a field's length meets certain requirements.

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

Member Function Documentation

FormValidatorLength::FormValidatorLength ( $form,
  $field,
  $type,
  $message,
  $comparator,
  $length 
)

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)
$comparator
$length

Definition at line 35 of file FormValidatorLength.inc.php.

FormValidatorLength::isValid ( )
See Also
FormValidator::isValid() Value is valid if it is empty and optional or meets the specified length requirements.
Returns
boolean

Definition at line 50 of file FormValidatorLength.inc.php.

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


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