AbstractCompositeValidator implements ObjectValidatorInterface, Countable

AbstractYes

An abstract composite validator consisting of other validators

Table of Contents

Interfaces

ObjectValidatorInterface
Contract for a validator
Countable

Properties

$options  : array<string|int, mixed>
$supportedOptions  : array<string|int, mixed>
This contains the supported options, their default values and descriptions.
$validatedInstancesContainer  : SplObjectStorage
$validators  : SplObjectStorage

Methods

addValidator()  : void
Adds a new validator to the composition.
count()  : int
Returns the number of validators contained in this composition.
getOptions()  : array<string|int, mixed>
Returns the options for this validator
getValidators()  : SplObjectStorage
Returns the child validators of this Composite Validator
removeValidator()  : void
Removes the specified validator.
setOptions()  : void
Receive validator options from framework.
setValidatedInstancesContainer()  : void
Allows to set a container to keep track of validated instances.
initializeDefaultOptions()  : void
Initialize default options.

Properties

$options

protected array<string|int, mixed> $options = []

$supportedOptions

This contains the supported options, their default values and descriptions.

protected array<string|int, mixed> $supportedOptions = []

$validatedInstancesContainer

protected SplObjectStorage $validatedInstancesContainer
Tags
todo:

Properties self::$validators and self::$validatedInstancesContainer are not properly initialized in this class because introducing a constructor is considered possibly breaking. However, it is unlikely that anyone extends this validator. Hence, it should be marked @internal in v13 and get a constructor. Both framework validators that extend this class, ConjunctionValidator and DisjunctionValidator do have a constructor. Their constructors need to be removed again then.

$validators

protected SplObjectStorage $validators

Methods

count()

Returns the number of validators contained in this composition.

public count() : int
Return values
int

getOptions()

Returns the options for this validator

public getOptions() : array<string|int, mixed>
Return values
array<string|int, mixed>

getValidators()

Returns the child validators of this Composite Validator

public getValidators() : SplObjectStorage
Return values
SplObjectStorage

setOptions()

Receive validator options from framework.

public setOptions(array<string|int, mixed> $options) : void
Parameters
$options : array<string|int, mixed>

setValidatedInstancesContainer()

Allows to set a container to keep track of validated instances.

public setValidatedInstancesContainer(SplObjectStorage $validatedInstancesContainer) : void
Parameters
$validatedInstancesContainer : SplObjectStorage

A container to keep track of validated instances

initializeDefaultOptions()

Initialize default options.

protected initializeDefaultOptions(array<string|int, mixed> $options) : void
Parameters
$options : array<string|int, mixed>
Tags
throws
InvalidValidationOptionsException

        
On this page

Search results