Abstract validator

package CONTENIDO Validator

 Methods

Returns list of validations errors

getErrors() : array

Returns

array

Option getter.

getOption(string $name) : mixed | null

Parameters

$name

string

Returns

mixednull

Validates the passed value.

isValid(mixed $value) : bool

Parameters

$value

mixed

Returns

bool

Single option setter.

setOption(string $name, mixed $value) 

Parameters

$name

string

$value

mixed

Options setter, merges passed options with previous set options.

setOptions(array $options) 

Parameters

$options

array

Abstract isValid method, which has to be implemented by childs

_isValid(mixed $value) : bool

Parameters

$value

mixed

Returns

bool

Adds a error.

addError(string $message, mixed $code) 

Parameters

$message

string

$code

mixed

 Properties

 

$_errors : array
 

$_options : array