PHP Класс Jyxo\Input\Chain

Автор: Jakub Tománek
Наследование: implements Jyxo\Input\ValidatorInterface
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$value mixed Actual variable value.

Открытые методы

Метод Описание
addCondition ( Conditional $chain ) : self Adds a new conditional subchain and returns its instance.
addFilter ( Jyxo\Input\FilterInterface $filter ) : self Adds a filter to the chain.
addValidator ( Jyxo\Input\ValidatorInterface $validator, string $errorMessage = null ) : Chain Adds a validator to the chain.
addWalk ( ) : self Adds a new subchain and returns its instance.
close ( ) : self In case of a subchain returns its parent, the chain itself otherwise.
getErrors ( ) : array Returns a list of validation errors.
getParent ( ) : self Returns the parent chain.
getValue ( ) : mixed Returns a filtered variable value.
isEmpty ( ) : boolean Returns if the chain contains any rules.
isValid ( mixed $value ) : boolean Returns if the value is valid.
setParent ( Chain $parent ) : self Sets the parent chain.

Приватные методы

Метод Описание
run ( mixed &$value ) : boolean Starts filtering and validation.

Описание методов

addCondition() публичный Метод

Adds a new conditional subchain and returns its instance.
public addCondition ( Conditional $chain ) : self
$chain Jyxo\Input\Chain\Conditional
Результат self

addFilter() публичный Метод

Adds a filter to the chain.
public addFilter ( Jyxo\Input\FilterInterface $filter ) : self
$filter Jyxo\Input\FilterInterface Filter
Результат self

addValidator() публичный Метод

Adds a validator to the chain.
public addValidator ( Jyxo\Input\ValidatorInterface $validator, string $errorMessage = null ) : Chain
$validator Jyxo\Input\ValidatorInterface Validator
$errorMessage string Validation error message
Результат Chain

addWalk() публичный Метод

Adds a new subchain and returns its instance.
public addWalk ( ) : self
Результат self

close() публичный Метод

In case of a subchain returns its parent, the chain itself otherwise.
public close ( ) : self
Результат self

getErrors() публичный Метод

Returns a list of validation errors.
public getErrors ( ) : array
Результат array

getParent() публичный Метод

Returns the parent chain.
public getParent ( ) : self
Результат self

getValue() публичный Метод

Returns a filtered variable value.
public getValue ( ) : mixed
Результат mixed

isEmpty() публичный Метод

Returns if the chain contains any rules.
public isEmpty ( ) : boolean
Результат boolean

isValid() публичный Метод

Returns if the value is valid.
public isValid ( mixed $value ) : boolean
$value mixed Input value
Результат boolean

setParent() публичный Метод

Sets the parent chain.
public setParent ( Chain $parent ) : self
$parent Chain Parent chain
Результат self

Описание свойств

$value защищенное свойство

Actual variable value.
protected mixed $value
Результат mixed