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

Public Member Functions

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

Data Fields

 $_acceptedValues
 
- Data Fields inherited from FormValidator
 $_field
 
 $_form
 
 $_message
 
 $_type
 
 $_validator
 

Detailed Description

Form validation check that checks if value is within a certain set.

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

Constructor & Destructor Documentation

◆ __construct()

FormValidatorInSet::__construct ( $form,
  $field,
  $type,
  $message,
  $acceptedValues 
)

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)
$acceptedValuesarray all possible accepted values

Reimplemented from FormValidator.

Definition at line 34 of file FormValidatorInSet.inc.php.

Member Function Documentation

◆ isValid()

FormValidatorInSet::isValid ( )

Value is valid if it is empty and optional or is in the set of accepted values.

See also
FormValidator::isValid()
Returns
boolean

Reimplemented from FormValidator.

Definition at line 48 of file FormValidatorInSet.inc.php.

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

Field Documentation

◆ $_acceptedValues

array FormValidatorInSet::$_acceptedValues

of all values accepted as valid

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


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