MediaWiki fundraising/REL1_35
ErrorState Class Reference

Public Member Functions

 addError ( $error)
 
 addErrors ( $errors)
 
 clearValidationError ( $field)
 Unset validation error for a specific field.
 
 getErrors ()
 
 hasErrors ()
 
 hasValidationError ( $field=null)
 Is a specific field invalid, or is any field invalid?
 

Protected Attributes

 $errors = []
 

Detailed Description

Definition at line 6 of file ErrorState.php.

Member Function Documentation

◆ addError()

ErrorState::addError ( $error)
Parameters
PaymentError | ValidationError$error

Definition at line 32 of file ErrorState.php.

References clearValidationError(), and hasValidationError().

Referenced by addErrors().

◆ addErrors()

ErrorState::addErrors ( $errors)

Definition at line 42 of file ErrorState.php.

References $errors, and addError().

◆ clearValidationError()

ErrorState::clearValidationError ( $field)

Unset validation error for a specific field.

Parameters
string$fielddata field name

Definition at line 14 of file ErrorState.php.

Referenced by addError().

◆ getErrors()

ErrorState::getErrors ( )
Returns
array PaymentError|ValidationError

Definition at line 51 of file ErrorState.php.

References $errors.

◆ hasErrors()

ErrorState::hasErrors ( )

Definition at line 55 of file ErrorState.php.

◆ hasValidationError()

ErrorState::hasValidationError ( $field = null)

Is a specific field invalid, or is any field invalid?

Parameters
string | null$fielddata field name, or null to check all fields
Returns
bool true if a validation error exists for the given field

Definition at line 65 of file ErrorState.php.

Referenced by addError().

Member Data Documentation

◆ $errors

ErrorState::$errors = []
protected

Definition at line 7 of file ErrorState.php.

Referenced by addErrors(), and getErrors().


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