Avolutions\Validation\AbstractValidator
implements ValidatorInterfaceAn abstract class which has to be extended by every Validator.
Properties
Property | Visibility | Type | Description |
---|---|---|---|
$Entity | protected | ?\Avolutions\Orm\Entity | The Entity to validate. |
$message | protected | ?string | A custom error message. |
$options | protected | array | An associative array with options. |
$property | protected | ?string | The property of the Entity to validate. |
Methods
Method | Visibility | Description |
---|---|---|
__construct() | public | Creates a new Validator object and set the options. |
getMessage() | public | Returns the error message of the validator. |
getValidatorName() | protected | Returns the name of the validator in lowercase and without suffix 'Validator'. |
setOptions() | public | Set the passed options, property and Entity to internal properties. |
Property Details
Method Details
__construct()
Creates a new Validator object and set the options.
public
__construct([array<string|int, mixed> $options = [] ][, string|null $property = null ][, Entity|null $Entity = null ]) : mixed
Parameters
array<string|int, mixed>
$options
(optional)
An associative array with options.
string|null
$property
(optional)
The property of the Entity to validate.
Entity|null
$Entity
(optional)
$Entity The Entity to validate.
getMessage()
Returns the error message of the validator.
public
getMessage() : string
Return values
string Returns the error message of the validator.setOptions()
Set the passed options, property and Entity to internal properties.
public
setOptions([array<string|int, mixed> $options = [] ][, string|null $property = null ][, Entity|null $Entity = null ]) : mixed
Parameters
array<string|int, mixed>
$options
(optional)
An associative array with options.
string|null
$property
(optional)
The property of the Entity to validate.
Entity|null
$Entity
(optional)
$Entity The Entity to validate.