Alpha
extends AbstractValidator
in package
Alphabetical validator class
Tags
Table of Contents
Properties
- $description : string|null
- Validator description
- $input : mixed
- Input value to test
- $message : string|null
- Validator message - The message provided when the validation fails
- $name : string|null
- Validator name
- $results : mixed
- Validator results - Optional results to collect post-validation, would be something that was set by a custom validator in its "evaluate" method
- $value : mixed
- Validator value to test against
Methods
- __construct() : mixed
- Constructor
- evaluate() : bool
- Method to evaluate the validator
- getDescription() : string|null
- Get the validator description
- getInput() : mixed
- Get the validator input
- getMessage() : string|null
- Get the validator default message
- getName() : string|null
- Get the validator name
- getResults() : mixed
- Get the validator results
- getValue() : mixed
- Get the validator value
- hasDescription() : bool
- Has validator description
- hasInput() : bool
- Has validator input
- hasMessage() : bool
- Has validator message
- hasName() : bool
- Has validator name
- hasResults() : bool
- Has validator results
- hasValue() : bool
- Has validator value
- setDescription() : static
- Set the validator description
- setInput() : AbstractValidator
- Set the validator input
- setMessage() : AbstractValidator
- Set the validator condition
- setName() : static
- Set the validator name
- setValue() : AbstractValidator
- Set the validator value
Properties
$description
Validator description
protected
string|null
$description
= null
$input
Input value to test
protected
mixed
$input
= null
$message
Validator message - The message provided when the validation fails
protected
string|null
$message
= null
$name
Validator name
protected
string|null
$name
= null
$results
Validator results - Optional results to collect post-validation, would be something that was set by a custom validator in its "evaluate" method
protected
mixed
$results
= null
$value
Validator value to test against
protected
mixed
$value
= null
Methods
__construct()
Constructor
public
__construct([mixed $value = null ][, string|null $message = null ][, string|null $name = null ][, string|null $description = null ]) : mixed
Instantiate the validator object
Parameters
- $value : mixed = null
- $message : string|null = null
- $name : string|null = null
- $description : string|null = null
evaluate()
Method to evaluate the validator
public
evaluate([mixed $input = null ]) : bool
Parameters
- $input : mixed = null
Return values
boolgetDescription()
Get the validator description
public
getDescription() : string|null
Return values
string|nullgetInput()
Get the validator input
public
getInput() : mixed
getMessage()
Get the validator default message
public
getMessage() : string|null
Return values
string|nullgetName()
Get the validator name
public
getName() : string|null
Return values
string|nullgetResults()
Get the validator results
public
getResults() : mixed
getValue()
Get the validator value
public
getValue() : mixed
hasDescription()
Has validator description
public
hasDescription() : bool
Return values
boolhasInput()
Has validator input
public
hasInput() : bool
Return values
boolhasMessage()
Has validator message
public
hasMessage() : bool
Return values
boolhasName()
Has validator name
public
hasName() : bool
Return values
boolhasResults()
Has validator results
public
hasResults() : bool
Return values
boolhasValue()
Has validator value
public
hasValue() : bool
Return values
boolsetDescription()
Set the validator description
public
setDescription([string|null $description = null ]) : static
Parameters
- $description : string|null = null
Return values
staticsetInput()
Set the validator input
public
setInput([mixed $input = null ]) : AbstractValidator
Parameters
- $input : mixed = null
Return values
AbstractValidatorsetMessage()
Set the validator condition
public
setMessage([string|null $message = null ]) : AbstractValidator
Parameters
- $message : string|null = null
Return values
AbstractValidatorsetName()
Set the validator name
public
setName([string|null $name = null ]) : static
Parameters
- $name : string|null = null
Return values
staticsetValue()
Set the validator value
public
setValue(mixed $value) : AbstractValidator
Parameters
- $value : mixed