Open Monograph Press  1.1
 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 ()
 

Public Attributes

 $_comparator
 
 $_length
 
- Public Attributes inherited from FormValidator
 $_field
 
 $_form
 
 $_message
 
 $_type
 
 $_validator
 

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 41 of file FormValidatorLength.inc.php.

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

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 56 of file FormValidatorLength.inc.php.

References $_length.

Member Data Documentation

string FormValidatorLength::$_comparator

comparator to use (== | != | < | > | <= | >= )

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

int FormValidatorLength::$_length

length to compare with

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

Referenced by isValid().


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