2 namespace TYPO3\CMS\Form\Domain\Validator;
52 $this->result = new \TYPO3\CMS\Extbase\Error\Result();
53 if ($this->acceptsEmptyValues ===
false || $this->
isEmpty($value) ===
false) {
54 if (!is_object($value)) {
55 $this->
addError(
'Object expected, %1$s given.', 1241099149, array(gettype($value)));
73 protected function getPropertyValue(\TYPO3\CMS\Form\Domain\Model\ValidationElement $validationElement, $propertyName)
82 if ($this->sessionUtility->getSessionData($propertyName)) {
83 $propertyValue = $this->sessionUtility->getSessionData($propertyName);
85 $propertyValue = $validationElement->getIncomingField($propertyName);
87 return $propertyValue;
99 protected function checkProperty($value, $validators, $propertyName)
103 foreach ($validators as $validator) {
104 if ($validator instanceof ObjectValidatorInterface) {
105 $validator->setValidatedInstancesContainer($this->validatedInstancesContainer);
116 isset($value[0][
'name'])
117 && isset($value[0][
'type'])
118 && isset($value[0][
'tmp_name'])
119 && isset($value[0][
'size'])
121 foreach ($value as $file) {
122 $currentResult = $validator->validate($file);
123 if ($currentResult->hasMessages()) {
127 $result->merge($currentResult);
132 $currentResult = $validator->validate($value);
133 if ($currentResult->hasMessages()) {
137 $result->merge($currentResult);
143 $this->result->forProperty($propertyName)->merge(
$result);
156 foreach ($this->propertyValidators as $propertyName => $validators) {
158 $this->checkProperty($propertyValue, $validators, $propertyName);
173 && $object instanceof \TYPO3\CMS\Form\Domain\Model\ValidationElement
190 if (!isset($this->propertyValidators[$propertyName])) {
191 $this->propertyValidators[$propertyName] = new \SplObjectStorage();
193 $this->propertyValidators[$propertyName]->attach($validator);
202 if ($this->validatedInstancesContainer === null) {
203 $this->validatedInstancesContainer = new \SplObjectStorage();
205 if ($this->validatedInstancesContainer->contains($object)) {
208 $this->validatedInstancesContainer->attach($object);
222 if ($propertyName !== null) {
223 return (isset($this->propertyValidators[$propertyName])) ? $this->propertyValidators[$propertyName] : array();
236 $count += $propertyValidators->count();