35 $this->result = new \TYPO3\CMS\Extbase\Error\Result();
36 if ($this->acceptsEmptyValues === FALSE || $this->
isEmpty($value) === FALSE) {
37 if (!is_object($value)) {
38 $this->
addError(
'Object expected, %1$s given.', 1241099149, array(gettype($value)));
58 if (\
TYPO3\CMS\Extbase\Reflection\ObjectAccess::isPropertyGettable($object, $propertyName)) {
59 return \TYPO3\CMS\Extbase\Reflection\ObjectAccess::getProperty($object, $propertyName);
61 return \TYPO3\CMS\Extbase\Reflection\ObjectAccess::getProperty($object, $propertyName, TRUE);
76 foreach ($validators as $validator) {
78 $validator->setValidatedInstancesContainer($this->validatedInstancesContainer);
80 $currentResult = $validator->validate($value);
81 if ($currentResult->hasMessages()) {
90 $this->result->forProperty($propertyName)->merge(
$result);
103 if ($this->configurationManager->isFeatureEnabled(
'rewrittenPropertyMapper')) {
104 foreach ($this->propertyValidators as $propertyName => $validators) {
106 $this->
checkProperty($propertyValue, $validators, $propertyName);
112 if (!is_object($object)) {
115 'validator.genericobject.noobject',
122 foreach (array_keys($this->propertyValidators) as $propertyName) {
140 return is_object($object);
156 if (!is_object($object)) {
157 throw new \InvalidArgumentException(
'Object expected, ' . gettype($object) .
' given.', 1241099149);
159 if (!isset($this->propertyValidators[$propertyName])) {
163 foreach ($this->propertyValidators[$propertyName] as $validator) {
164 $validator->isValid(\
TYPO3\CMS\Extbase\Reflection\ObjectAccess::getProperty($object, $propertyName));
165 if (count($validator->getErrors()) > 0) {
180 if (!isset($this->errors[$propertyName])) {
181 $this->errors[$propertyName] = new \TYPO3\CMS\Extbase\Validation\PropertyError($propertyName);
183 $this->errors[$propertyName]->addErrors(
$errors);
195 if (!isset($this->propertyValidators[$propertyName])) {
196 $this->propertyValidators[$propertyName] = new \SplObjectStorage();
198 $this->propertyValidators[$propertyName]->attach($validator);
206 if ($this->validatedInstancesContainer === NULL) {
207 $this->validatedInstancesContainer = new \SplObjectStorage();
209 if ($this->validatedInstancesContainer->contains($object)) {
212 $this->validatedInstancesContainer->attach($object);
225 if ($propertyName !== NULL) {
226 return (isset($this->propertyValidators[$propertyName])) ? $this->propertyValidators[$propertyName] : array();
addError($message, $code, array $arguments=array(), $title='')
addPropertyValidator($propertyName, \TYPO3\CMS\Extbase\Validation\Validator\ValidatorInterface $validator)
isValidatedAlready($object)
getPropertyValidators($propertyName=NULL)
addErrorsForProperty($errors, $propertyName)
translateErrorMessage($translateKey, $extensionName, $arguments=array())
injectConfigurationManager(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface $configurationManager)
setValidatedInstancesContainer(\SplObjectStorage $validatedInstancesContainer)
checkProperty($value, $validators, $propertyName)
isPropertyValid($object, $propertyName)
$validatedInstancesContainer
getPropertyValue($object, $propertyName)