Open Journal Systems  3.3.0
FormValidatorLength Class Reference
Inheritance diagram for FormValidatorLength:
FormValidator

Public Member Functions

 __construct (&$form, $field, $type, $message, $comparator, $length)
 
 getMessage ()
 
 isValid ()
 
- Public Member Functions inherited from FormValidator
 __construct (&$form, $field, $type, $message, $validator=null)
 
 getField ()
 
 getFieldValue ()
 
getForm ()
 
 getType ()
 
getValidator ()
 
 isEmptyAndOptional ()
 

Data Fields

 $_comparator
 
 $_length
 
- Data Fields 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.

Constructor & Destructor Documentation

◆ __construct()

FormValidatorLength::__construct ( $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.

Member Function Documentation

◆ getMessage()

FormValidatorLength::getMessage ( )
See also
FormValidator::getMessage()
Returns
string

Reimplemented from FormValidator.

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

◆ isValid()

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

Reimplemented from FormValidator.

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

References $_length, FormValidator\getFieldValue(), FormValidator\isEmptyAndOptional(), and PKPString\strlen().

Field Documentation

◆ $_comparator

string FormValidatorLength::$_comparator

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

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

◆ $_length

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: