ValidatorInterface
in
Table of Contents
- addRule() : mixed
- Adds a ValidatorRule to use with the created Validator.
- getErrors() : array<string|int, mixed>
- Returns all the errors in a multidimensional array with each error nested under the data field's name.
- validate() : mixed
- Validates a field's value using the provided ValidatorRule's map name.
Methods
addRule()
Adds a ValidatorRule to use with the created Validator.
public
addRule(string $identifier, string $rule) : mixed
Parameters
- $identifier : string
-
The "map name" or name to reference this rule by.
- $rule : string
-
The ValidatorRule's namespace (FQPN).
Return values
mixed —getErrors()
Returns all the errors in a multidimensional array with each error nested under the data field's name.
public
getErrors() : array<string|int, mixed>
Return values
array<string|int, mixed> —validate()
Validates a field's value using the provided ValidatorRule's map name.
public
validate(array<string|int, mixed> $data, bool $sendErrorResponses) : mixed
Parameters
- $data : array<string|int, mixed>
- $sendErrorResponses : bool