PHP Class Jyxo\Input\Chain\Conditional

The validation itself is performed after fulfilling the condition. The condition is checked by a defined validator.
Author: Roman Řáha
Inheritance: extends Jyxo\Input\Chain
Datei anzeigen Open project: jyxo/php Class Usage Examples

Public Methods

Method Description
__construct ( Jyxo\Input\ValidatorInterface $validator = null ) Sets the condition validator.
isValid ( mixed $value ) : boolean Validates a value.
setCondValidator ( Jyxo\Input\ValidatorInterface $validator ) : self Sets the condition validator.

Private Methods

Method Description
checkCondition ( mixed $value ) : boolean Checks if the condition is fulfilled.

Method Details

__construct() public method

Sets the condition validator.
public __construct ( Jyxo\Input\ValidatorInterface $validator = null )
$validator Jyxo\Input\ValidatorInterface

isValid() public method

Validates a value.
public isValid ( mixed $value ) : boolean
$value mixed Input value
return boolean

setCondValidator() public method

Sets the condition validator.
public setCondValidator ( Jyxo\Input\ValidatorInterface $validator ) : self
$validator Jyxo\Input\ValidatorInterface Condition validator
return self