Open Journal Systems
3.3.0
|
Public Member Functions | |
__construct (&$form, $field, $type, $message, $validator=null) | |
getField () | |
getFieldValue () | |
& | getForm () |
getMessage () | |
getType () | |
& | getValidator () |
isEmptyAndOptional () | |
isValid () | |
Data Fields | |
$_field | |
$_form | |
$_message | |
$_type | |
$_validator | |
Class to represent a form validation check.
Definition at line 23 of file FormValidator.inc.php.
FormValidator::__construct | ( | & | $form, |
$field, | |||
$type, | |||
$message, | |||
$validator = null |
|||
) |
Constructor.
$form | Form the associated form |
$field | string the name of the associated field |
$type | string the type of check, either "required" or "optional" |
$message | string the error message for validation failures (i18n key) |
$validator | Validator the validator used to validate this form field (optional) |
Reimplemented in FormValidatorLocaleEmail, FormValidatorLocaleUrl, FormValidatorRegExp, FormValidatorArray, and FormValidatorInSet.
Definition at line 63 of file FormValidator.inc.php.
FormValidator::getField | ( | ) |
Get the field associated with the check.
Definition at line 84 of file FormValidator.inc.php.
References $_field.
Referenced by FormValidatorLocale\getFieldValue(), getFieldValue(), FormValidatorBoolean\isValid(), FormValidatorArray\isValid(), and FormValidatorArrayCustom\isValid().
FormValidator::getFieldValue | ( | ) |
Get field value
Reimplemented in FormValidatorLocale.
Definition at line 154 of file FormValidator.inc.php.
References getField(), and getForm().
Referenced by FormValidatorEmail\getMessage(), FormValidatorArrayCustom\isArray(), isEmptyAndOptional(), FormValidatorBoolean\isValid(), FormValidatorInSet\isValid(), FormValidatorArray\isValid(), FormValidatorLength\isValid(), FormValidatorCustom\isValid(), FormValidatorArrayCustom\isValid(), and isValid().
& FormValidator::getForm | ( | ) |
Get the form associated with the check
Definition at line 100 of file FormValidator.inc.php.
References $_form.
Referenced by FormValidatorLocale\getFieldValue(), getFieldValue(), FormValidatorBoolean\isValid(), and FormValidatorReCaptcha\isValid().
FormValidator::getMessage | ( | ) |
Get the error message associated with a failed validation check.
Reimplemented in FormValidatorCustom, FormValidatorLength, FormValidatorLocale, and FormValidatorEmail.
Definition at line 92 of file FormValidator.inc.php.
FormValidator::getType | ( | ) |
Get the type of the validated field ('optional' or 'required')
Definition at line 116 of file FormValidator.inc.php.
References $_type.
Referenced by isEmptyAndOptional(), FormValidatorArray\isValid(), and FormValidatorArrayCustom\isValid().
& FormValidator::getValidator | ( | ) |
Get the validator associated with the check
Definition at line 108 of file FormValidator.inc.php.
References $_validator.
Referenced by isValid().
FormValidator::isEmptyAndOptional | ( | ) |
Check if field value is empty and optional.
Definition at line 165 of file FormValidator.inc.php.
References getFieldValue(), and getType().
Referenced by FormValidatorInSet\isValid(), FormValidatorLength\isValid(), FormValidatorCustom\isValid(), FormValidatorArrayCustom\isValid(), and isValid().
FormValidator::isValid | ( | ) |
Check if field value is valid. Default check is that field is either optional or not empty.
Reimplemented in FormValidatorArrayCustom, FormValidatorCustom, FormValidatorLength, FormValidatorArray, FormValidatorReCaptcha, FormValidatorInSet, FormValidatorBoolean, FormValidatorCSRF, and FormValidatorPost.
Definition at line 129 of file FormValidator.inc.php.
References getFieldValue(), getValidator(), and isEmptyAndOptional().
string FormValidator::$_field |
The name of the field
Definition at line 35 of file FormValidator.inc.php.
Referenced by getField().
Form FormValidator::$_form |
The Form associated with the check
Definition at line 29 of file FormValidator.inc.php.
Referenced by getForm().
string FormValidator::$_message |
The error message associated with a validation failure
Definition at line 47 of file FormValidator.inc.php.
string FormValidator::$_type |
The type of check ("required" or "optional")
Definition at line 41 of file FormValidator.inc.php.
Referenced by getType().
Validator FormValidator::$_validator |
The validator used to validate the field
Definition at line 53 of file FormValidator.inc.php.
Referenced by getValidator().