DataValidation
in package
[$validation = $this->core->loadClass('DataValidation');] Class to facilitate data validation
Table of Contents
Properties
- $error : mixed
- $errorFields : mixed
- $errorMsg : mixed
- $field : mixed
- $typeError : mixed
Methods
- setError() : mixed
- transformValue() : mixed
- Transform data based on obtions: forcevalue, defaultvalue, trim, tolowercase, touppercase
- validateDate() : bool
- Formats: Length bt. 8 to 10 depending of the year formar (YY or YYYY)
- validateDateTime() : bool
- Formats: Length bt. 15 to 17 depending of the year formar (YY or YYYY)
- validateDateTimeISO() : bool
- Formats: Length bt. 23 or 25 depending of the year formar (YY or YYYY)
- validateEmail() : mixed
- validateFixLength() : mixed
- validateMaxLength() : mixed
- validateMinLength() : mixed
- validateModel() : bool
- Validate the content of $data based on $model
- validateName() : mixed
- validateRange() : mixed
- validateRegexMatch() : bool|int
- Validate if the content match with a regex expresion
- validateUnsigned() : mixed
- validateValues() : mixed
- validContent() : mixed
- validType() : bool
- Validate no empty data based in the type
- extractOptionValue() : mixed
Properties
$error
public
mixed
$error
= \false
$errorFields
public
mixed
$errorFields
= []
$errorMsg
public
mixed
$errorMsg
= ''
$field
public
mixed
$field
= \null
$typeError
public
mixed
$typeError
= 'field'
Methods
setError()
public
setError(mixed $msg) : mixed
Parameters
- $msg : mixed
transformValue()
Transform data based on obtions: forcevalue, defaultvalue, trim, tolowercase, touppercase
public
transformValue( $data, $options) : mixed
Parameters
validateDate()
Formats: Length bt. 8 to 10 depending of the year formar (YY or YYYY)
public
validateDate( $data) : bool
Parameters
Return values
boolvalidateDateTime()
Formats: Length bt. 15 to 17 depending of the year formar (YY or YYYY)
public
validateDateTime( $data) : bool
Parameters
Return values
boolvalidateDateTimeISO()
Formats: Length bt. 23 or 25 depending of the year formar (YY or YYYY)
public
validateDateTimeISO( $data) : bool
Parameters
Return values
boolvalidateEmail()
public
validateEmail(mixed $key, mixed $options, mixed $data) : mixed
Parameters
- $key : mixed
- $options : mixed
- $data : mixed
validateFixLength()
public
validateFixLength(mixed $key, mixed $options, mixed $data) : mixed
Parameters
- $key : mixed
- $options : mixed
- $data : mixed
validateMaxLength()
public
validateMaxLength(mixed $key, mixed $options, mixed $data) : mixed
Parameters
- $key : mixed
- $options : mixed
- $data : mixed
validateMinLength()
public
validateMinLength(mixed $key, mixed $options, mixed $data) : mixed
Parameters
- $key : mixed
- $options : mixed
- $data : mixed
validateModel()
Validate the content of $data based on $model
public
validateModel(array<string|int, mixed> &$model, array<string|int, mixed> &$data[, array<string|int, mixed> &$dictionaries = [] ][, bool $all = true ][, string $extrakey = '' ]) : bool
Parameters
- $model : array<string|int, mixed>
- $data : array<string|int, mixed>
- $dictionaries : array<string|int, mixed> = []
- $all : bool = true
- $extrakey : string = ''
Return values
boolvalidateName()
public
validateName(mixed $key, mixed $data) : mixed
Parameters
- $key : mixed
- $data : mixed
validateRange()
public
validateRange(mixed $key, mixed $options, mixed $data) : mixed
Parameters
- $key : mixed
- $options : mixed
- $data : mixed
validateRegexMatch()
Validate if the content match with a regex expresion
public
validateRegexMatch( $key, $options, $data) : bool|int
Parameters
Return values
bool|intvalidateUnsigned()
public
validateUnsigned(mixed $key, mixed $options, mixed $data) : mixed
Parameters
- $key : mixed
- $options : mixed
- $data : mixed
validateValues()
public
validateValues(mixed $key, mixed $options, mixed $data) : mixed
Parameters
- $key : mixed
- $options : mixed
- $data : mixed
validContent()
public
validContent(mixed $key, mixed $options, mixed &$data[, array<string|int, mixed> &$dictionaries = [] ]) : mixed
Parameters
- $key : mixed
- $options : mixed
- $data : mixed
- $dictionaries : array<string|int, mixed> = []
validType()
Validate no empty data based in the type
public
validType( $key, $type, &$data) : bool
Parameters
Return values
boolextractOptionValue()
private
extractOptionValue(mixed $tag, mixed $options) : mixed
Parameters
- $tag : mixed
- $options : mixed