Open Journal Systems  3.3.0
FormValidatorLocale Class Reference
Inheritance diagram for FormValidatorLocale:
FormValidator FormValidatorLocaleEmail FormValidatorLocaleUrl

Public Member Functions

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

Data Fields

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

Detailed Description

Class to represent a form validation check for localized fields.

Definition at line 16 of file FormValidatorLocale.inc.php.

Constructor & Destructor Documentation

◆ __construct()

FormValidatorLocale::__construct ( $form,
  $field,
  $type,
  $message,
  $requiredLocale = null,
  $validator = null 
)

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)
$validatorValidator the validator used to validate this form field (optional)
$requiredLocaleThe name of the required locale, i.e. en_US

Definition at line 32 of file FormValidatorLocale.inc.php.

References AppLocale\getPrimaryLocale().

Member Function Documentation

◆ getFieldValue()

FormValidatorLocale::getFieldValue ( )
See also
FormValidator::getFieldValue()
Returns
mixed

Reimplemented from FormValidator.

Definition at line 58 of file FormValidatorLocale.inc.php.

References $_requiredLocale, FormValidator\getField(), and FormValidator\getForm().

◆ getMessage()

FormValidatorLocale::getMessage ( )

Get the error message associated with a failed validation check.

See also
FormValidator::getMessage()
Returns
string

Reimplemented from FormValidator.

Definition at line 46 of file FormValidatorLocale.inc.php.

References $_requiredLocale, and PKPLocale\getAllLocales().

Field Documentation

◆ $_requiredLocale

string FormValidatorLocale::$_requiredLocale

Symbolic name of the locale to require

Definition at line 21 of file FormValidatorLocale.inc.php.

Referenced by getFieldValue(), and getMessage().


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