ConjunctionValidator

final class \TYPO3\CMS\Extbase\Validation\Validator\ConjunctionValidator

Extends
AbstractCompositeValidator

Validator to chain many validators in a conjunction (logical and).

Table of Contents

Properties

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

Methods

__construct()  : mixed
addValidator()  : void
Adds a new validator to the composition.
count()  : int
Returns the number of validators contained in this composition.
getOptions()  : array
Returns the options for this validator
getRequest()  : ServerRequestInterface|null
Returns the request object of the validator.
getValidators()  : SplObjectStorage<string|int, ValidatorInterface>
Returns the child validators of this Composite Validator
removeValidator()  : void
Removes the specified validator.
setOptions()  : void
Receive validator options from framework.
setRequest()  : void
Sets the request object to the validator.
setValidatedInstancesContainer()  : void
Allows to set a container to keep track of validated instances.
validate()  : Result
Checks if the given value is valid according to the validators of the conjunction.
initializeDefaultOptions()  : void
Initialize default options.

Properties

$request

protected ServerRequestInterface|null $request = null

$supportedOptions

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

protected array $supportedOptions = []

$validatedInstancesContainer

protected SplObjectStorage $validatedInstancesContainer

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

Return values

array

getRequest()

Returns the request object of the validator.

public getRequest() : ServerRequestInterface|null

Return values

ServerRequestInterface|null

setOptions()

Receive validator options from framework.

public setOptions(array $options) : void

Parameters

$options : array

setRequest()

Sets the request object to the validator.

public setRequest(ServerRequestInterface|null $request) : void

Parameters

$request : ServerRequestInterface|null

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

validate()

Checks if the given value is valid according to the validators of the conjunction.

public validate(mixed $value) : Result

Every validator has to be valid, to make the whole conjunction valid.

Parameters

$value : mixed

The value that should be validated

Return values

Result
On this page