TYPO3  7.6
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
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=array())
 
 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=array(), $title= '')
 
 isEmpty ($value)
 
 translateErrorMessage ($translateKey, $extensionName, $arguments=array())
 

Protected Attributes

 $supportedOptions
 
 $validatorResolver
 
- Protected Attributes inherited from GenericObjectValidator
 $propertyValidators = array()
 
 $validatedInstancesContainer
 
- Protected Attributes inherited from AbstractValidator
 $acceptsEmptyValues = true
 
 $supportedOptions = array()
 
 $options = array()
 
 $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.

References elseif.

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(), elseif, TypeHandlingUtility\isCollectionType(), AbstractValidator\isEmpty(), CollectionValidator\isValid(), and GenericObjectValidator\isValidatedAlready().

Member Data Documentation

$supportedOptions
protected
Initial value:
= array(
'elementValidator' => array(null, 'The validator type to use for the collection elements', 'string'),
'elementType' => array(null, 'The type of the elements in the collection', 'string'),
'validationGroups' => array(null, 'The validation groups to link to', 'string'),
)

Definition at line 27 of file CollectionValidator.php.

$validatorResolver
protected

Definition at line 36 of file CollectionValidator.php.

Referenced by CollectionValidator\injectValidatorResolver().