ConjunctionValidator
class ConjunctionValidator extends AbstractCompositeValidator (View source)
Validator to chain many validators in a conjunction (logical and).
Properties
protected array | $supportedOptions | This contains the supported options, their default values and descriptions. |
from AbstractCompositeValidator |
protected array | $options | from AbstractCompositeValidator | |
protected SplObjectStorage | $validators | from AbstractCompositeValidator | |
protected SplObjectStorage | $validatedInstancesContainer | from AbstractCompositeValidator |
Methods
Constructs the composite validator and sets validation options
Allows to set a container to keep track of validated instances.
Returns the number of validators contained in this conjunction.
Returns the child validators of this Composite Validator
Details
__construct(array $options = [])
Constructs the composite validator and sets validation options
void
setValidatedInstancesContainer(SplObjectStorage $validatedInstancesContainer)
Allows to set a container to keep track of validated instances.
void
addValidator(ValidatorInterface $validator)
Adds a new validator to the conjunction.
removeValidator(ValidatorInterface $validator)
Removes the specified validator.
int
count()
Returns the number of validators contained in this conjunction.
SplObjectStorage
getValidators()
Returns the child validators of this Composite Validator
array
getOptions()
Returns the options for this validator
Result
validate(mixed $value)
Checks if the given value is valid according to the validators of the conjunction.
Every validator has to be valid, to make the whole conjunction valid.