28 'elementValidator' => array(NULL,
'The validator type to use for the collection elements',
'string'),
29 'elementType' => array(NULL,
'The type of the elements in the collection',
'string'),
30 'validationGroups' => array(NULL,
'The validation groups to link to',
'string'),
48 $this->result = new \TYPO3\CMS\Extbase\Error\Result();
50 if ($this->acceptsEmptyValues === FALSE || $this->
isEmpty($value) === FALSE) {
52 $this->
addError(
'The given subject was not a collection.', 1317204797);
54 } elseif ($value instanceof \
TYPO3\CMS\Extbase\Persistence\Generic\LazyObjectStorage && !$value->isInitialized()) {
78 if (!$this->configurationManager->isFeatureEnabled(
'rewrittenPropertyMapper')) {
80 if ($this->validatedInstancesContainer == NULL) {
81 $this->validatedInstancesContainer = new \SplObjectStorage();
84 if ($this->result == NULL) {
85 $this->result = new \TYPO3\CMS\Extbase\Error\Result();
89 foreach ($value as $index => $collectionElement) {
90 if (isset($this->options[
'elementValidator'])) {
91 $collectionElementValidator = $this->validatorResolver->createValidator($this->options[
'elementValidator']);
92 } elseif (isset($this->options[
'elementType'])) {
93 if (isset($this->options[
'validationGroups'])) {
94 $collectionElementValidator = $this->validatorResolver->getBaseValidatorConjunction($this->options[
'elementType'], $this->options[
'validationGroups']);
96 $collectionElementValidator = $this->validatorResolver->getBaseValidatorConjunction($this->options[
'elementType']);
102 $collectionElementValidator->setValidatedInstancesContainer($this->validatedInstancesContainer);
104 $this->result->forProperty($index)->merge($collectionElementValidator->validate($collectionElement));
addError($message, $code, array $arguments=array(), $title='')
isValidatedAlready($object)
static isCollectionType($type)