BuildingValidation
extends SchemaValidator
in package
Table of Contents
- $fields : array<string|int, mixed>
- set of fields that form can contain
- $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
Properties
$fields
set of fields that form can contain
protected
array<string|int, mixed>
$fields
= ['name', 'openTime', 'closeTime']
$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(mixed $validator) : void
Parameters
- $validator : mixed
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