UserValidator
extends Validator
in package
Validates user data <br> Used for avoid client errors when creating new users or granting access to databases.
Tags
Table of Contents
Methods
- __construct() : mixed
- Validator constructor.
- rules() : array<string|int, mixed>
- Rules for user.
- validate() : true
- Validate user data
Methods
__construct()
Validator constructor.
public
__construct([array<string|int, mixed> $data = [] ]) : mixed
Parameters
- $data : array<string|int, mixed> = []
-
Attributes to validate.
rules()
Rules for user.
public
rules() : array<string|int, mixed>
Return values
array<string|int, mixed>validate()
Validate user data
public
validate() : true
Tags
Return values
true —if validation is successful, throw an exception otherwise.