TYPO3CMS  8
 All Classes Namespaces Files Functions Variables Pages
CollectionValidator Class Reference
Inheritance diagram for CollectionValidator:
GenericObjectValidator AbstractValidator ObjectValidatorInterface ValidatorInterface ValidatorInterface

Public Member Functions

 injectValidatorResolver (\TYPO3\CMS\Extbase\Validation\ValidatorResolver $validatorResolver)
 
 validate ($value)
 
- Public Member Functions inherited from GenericObjectValidator
 validate ($value)
 
 canValidate ($object)
 
 addPropertyValidator ($propertyName, ValidatorInterface $validator)
 
 getPropertyValidators ($propertyName=null)
 
 setValidatedInstancesContainer (\SplObjectStorage $validatedInstancesContainer)
 
- Public Member Functions inherited from AbstractValidator
 __construct (array $options=[])
 
 validate ($value)
 
 getOptions ()
 

Protected Member Functions

 isValid ($value)
 
- Protected Member Functions inherited from GenericObjectValidator
 getPropertyValue ($object, $propertyName)
 
 isValid ($object)
 
 isValidatedAlready ($object)
 
- Protected Member Functions inherited from AbstractValidator
 isValid ($value)
 
 addError ($message, $code, array $arguments=[], $title= '')
 
 isEmpty ($value)
 
 translateErrorMessage ($translateKey, $extensionName, $arguments=[])
 

Protected Attributes

 $supportedOptions
 
 $validatorResolver
 
- Protected Attributes inherited from GenericObjectValidator
 $propertyValidators = []
 
 $validatedInstancesContainer
 
- Protected Attributes inherited from AbstractValidator
 $acceptsEmptyValues = true
 
 $supportedOptions = []
 
 $options = []
 
 $result
 

Detailed Description

A generic collection validator.

Definition at line 22 of file CollectionValidator.php.

Member Function Documentation

injectValidatorResolver ( \TYPO3\CMS\Extbase\Validation\ValidatorResolver  $validatorResolver)
Parameters
\TYPO3\CMS\Extbase\Validation\ValidatorResolver$validatorResolver

Definition at line 41 of file CollectionValidator.php.

References CollectionValidator\$validatorResolver.

isValid (   $value)
protected

Checks for a collection and if needed validates the items in the collection. This is done with the specified element validator or a validator based on the given element type and validation group.

Either elementValidator or elementType must be given, otherwise validation will be skipped.

Parameters
mixed$valueA collection to be validated
Returns
void

Definition at line 84 of file CollectionValidator.php.

Referenced by CollectionValidator\validate().

validate (   $value)

Checks if the given value is valid according to the validator, and returns the Error Messages object which occurred.

Parameters
mixed$valueThe value that should be validated
Returns

Implements ValidatorInterface.

Definition at line 54 of file CollectionValidator.php.

References AbstractValidator\$result, AbstractValidator\addError(), TypeHandlingUtility\isCollectionType(), AbstractValidator\isEmpty(), CollectionValidator\isValid(), and GenericObjectValidator\isValidatedAlready().

Member Data Documentation

$supportedOptions
protected
Initial value:
= [
'elementValidator' => [null, 'The validator type to use for the collection elements', 'string']

Definition at line 27 of file CollectionValidator.php.

$validatorResolver
protected

Definition at line 36 of file CollectionValidator.php.

Referenced by CollectionValidator\injectValidatorResolver().