CreateValidator
extends UserValidator
in package
Table of Contents
- $fields : array<string|int, mixed>
- {@inheritDoc}
- $validator : Validator
- CakePHP validator
- __construct() : mixed
- validateForm() : void
- Executes validation rules
- defineSchema() : void
- Performs schmea definition on giver validator
- setAsNameString() : mixed
- Declares given field as name string with regex: ^[\\w\\s\\.-]+$
- setAsRequired() : void
- Sets fields as required
- setAsType() : void
- Declares a filed in list to be a specific type
- setUpPassword() : void
- sets up password validation for given key
Properties
$fields
{@inheritDoc}
protected
array<string|int, mixed>
$fields
= ['email', 'password', 'name', 'surname']
$validator
CakePHP validator
private
Validator
$validator
Methods
__construct()
public
__construct() : mixed
Return values
mixed —validateForm()
Executes validation rules
public
validateForm(stdClass $form) : void
Parameters
- $form : stdClass
Tags
Return values
void —defineSchema()
Performs schmea definition on giver validator
protected
defineSchema(Validator $validator) : void
Parameters
- $validator : Validator
Return values
void —setAsNameString()
Declares given field as name string with regex: ^[\\w\\s\\.-]+$
protected
setAsNameString(mixed $field, mixed $message) : mixed
Parameters
- $field : mixed
- $message : mixed
Return values
mixed —setAsRequired()
Sets fields as required
protected
setAsRequired(array<string|int, mixed> $fields) : void
Parameters
- $fields : array<string|int, mixed>
Return values
void —setAsType()
Declares a filed in list to be a specific type
protected
setAsType(array<string|int, mixed> $fields, string $type) : void
Parameters
- $fields : array<string|int, mixed>
- $type : string
Return values
void —setUpPassword()
sets up password validation for given key
protected
setUpPassword(Validator $validator[, string $key = 'password' ]) : void
Parameters
- $validator : Validator
- $key : string = 'password'