Elgg  Version master
Public Member Functions | Protected Attributes | List of all members
Elgg\Validation\ValidationResult Class Reference

Represents a parameter that has been validated. More...

Public Member Functions

 __construct (protected string $name, protected $value)
 Constructor. More...
 
 pass (string $message= '')
 Set parameter value as passing validation. More...
 
 fail (string $error= '')
 Set parameter value as failing validation. More...
 
 isValid ()
 Is parameter value valid? More...
 
 getName ()
 Get parameter name. More...
 
 getValue ()
 Get parameter valud. More...
 
 getError ()
 Get error message. More...
 
 getMessage ()
 Get success message. More...
 

Protected Attributes

string $message = ''
 
string $error = ''
 

Detailed Description

Represents a parameter that has been validated.

Definition at line 8 of file ValidationResult.php.

Constructor & Destructor Documentation

Elgg\Validation\ValidationResult::__construct ( protected string  $name,
protected  $value 
)

Constructor.

Parameters
string$nameParameter name
mixed$valueParameter value

Definition at line 20 of file ValidationResult.php.

Member Function Documentation

Elgg\Validation\ValidationResult::fail ( string  $error = '')

Set parameter value as failing validation.

Parameters
string$errorOptional error message
Returns
void

Definition at line 41 of file ValidationResult.php.

Elgg\Validation\ValidationResult::getError ( )

Get error message.

Returns
string

Definition at line 77 of file ValidationResult.php.

Elgg\Validation\ValidationResult::getMessage ( )

Get success message.

Returns
string

Definition at line 86 of file ValidationResult.php.

Elgg\Validation\ValidationResult::getName ( )

Get parameter name.

Returns
string

Definition at line 59 of file ValidationResult.php.

Elgg\Validation\ValidationResult::getValue ( )

Get parameter valud.

Returns
mixed

Definition at line 68 of file ValidationResult.php.

Elgg\Validation\ValidationResult::isValid ( )

Is parameter value valid?

Returns
bool

Definition at line 50 of file ValidationResult.php.

Elgg\Validation\ValidationResult::pass ( string  $message = '')

Set parameter value as passing validation.

Parameters
string$messageOptional message
Returns
void

Definition at line 30 of file ValidationResult.php.

Member Data Documentation

string Elgg\Validation\ValidationResult::$error = ''
protected

Definition at line 12 of file ValidationResult.php.

string Elgg\Validation\ValidationResult::$message = ''
protected

Definition at line 10 of file ValidationResult.php.


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