TYPO3 CMS  TYPO3_6-2
TYPO3\CMS\Extbase\Mvc\Controller\ArgumentsValidator Class Reference
Inheritance diagram for TYPO3\CMS\Extbase\Mvc\Controller\ArgumentsValidator:
TYPO3\CMS\Extbase\Validation\Validator\AbstractObjectValidator TYPO3\CMS\Extbase\Validation\Validator\AbstractValidator TYPO3\CMS\Extbase\Validation\Validator\ObjectValidatorInterface TYPO3\CMS\Extbase\Validation\Validator\ValidatorInterface TYPO3\CMS\Extbase\Validation\Validator\ValidatorInterface Tx_Extbase_MVC_Controller_ArgumentsValidator

Public Member Functions

 isValid ($arguments)
 
 canValidate ($object)
 
 isPropertyValid ($arguments, $argumentName)
 
- Public Member Functions inherited from TYPO3\CMS\Extbase\Validation\Validator\AbstractObjectValidator
 setValidatedInstancesContainer (\SplObjectStorage $validatedInstancesContainer)
 
- Public Member Functions inherited from TYPO3\CMS\Extbase\Validation\Validator\AbstractValidator
 __construct (array $options=array())
 
 validate ($value)
 
 setOptions (array $options)
 
 getErrors ()
 
 getOptions ()
 

Protected Member Functions

 addErrorsForArgument (array $errors, $argumentName)
 
- Protected Member Functions inherited from TYPO3\CMS\Extbase\Validation\Validator\AbstractValidator
 isValid ($value)
 
 addError ($message, $code, array $arguments=array(), $title='')
 
 isEmpty ($value)
 
 translateErrorMessage ($translateKey, $extensionName, $arguments=array())
 

Additional Inherited Members

- Protected Attributes inherited from TYPO3\CMS\Extbase\Validation\Validator\AbstractValidator
 $acceptsEmptyValues = TRUE
 
 $supportedOptions = array()
 
 $options = array()
 
 $errors = array()
 
 $result
 

Detailed Description

This file is part of the TYPO3 CMS project.

It is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, either version 2 of the License, or any later version.

For the full copyright and license information, please read the LICENSE.txt file that was distributed with this source code.

The TYPO3 project - inspiring people to share! A validator for controller arguments

Deprecated:
since Extbase 1.4.0, will be removed two versions after Extbase 6.1 Is only needed for old property mapper.

Definition at line 21 of file ArgumentsValidator.php.

Member Function Documentation

◆ addErrorsForArgument()

TYPO3\CMS\Extbase\Mvc\Controller\ArgumentsValidator::addErrorsForArgument ( array  $errors,
  $argumentName 
)
protected

Adds the given errors to $this->errors and creates an ArgumentError instance if needed.

Parameters
array$errorsArray of
string$argumentNameName of the argument to add errors for
Returns
void

Definition at line 97 of file ArgumentsValidator.php.

Referenced by TYPO3\CMS\Extbase\Mvc\Controller\ArgumentsValidator\isPropertyValid().

◆ canValidate()

TYPO3\CMS\Extbase\Mvc\Controller\ArgumentsValidator::canValidate (   $object)

Checks the given object can be validated by the validator implementation

Parameters
object$objectThe object to be checked
Returns
boolean TRUE if this validator can validate instances of the given object or FALSE if it can't

Implements TYPO3\CMS\Extbase\Validation\Validator\ObjectValidatorInterface.

Definition at line 53 of file ArgumentsValidator.php.

◆ isPropertyValid()

TYPO3\CMS\Extbase\Mvc\Controller\ArgumentsValidator::isPropertyValid (   $arguments,
  $argumentName 
)

Checks if the specified property (ie. the argument) of the given arguments object is valid. Validity is checked by first invoking the validation chain defined in the argument object.

If at least one error occurred, the result is FALSE.

Parameters
object$argumentsThe arguments object containing the property (argument) to validate
string$argumentNameName of the property (ie. name of the argument) to validate
Exceptions

Implements TYPO3\CMS\Extbase\Validation\Validator\ObjectValidatorInterface.

Definition at line 69 of file ArgumentsValidator.php.

References TYPO3\CMS\Extbase\Mvc\Controller\ArgumentsValidator\addErrorsForArgument().

Referenced by TYPO3\CMS\Extbase\Mvc\Controller\ArgumentsValidator\isValid().

◆ isValid()

TYPO3\CMS\Extbase\Mvc\Controller\ArgumentsValidator::isValid (   $arguments)

Checks if the given value (ie. an Arguments object) is valid.

If at least one error occurred, the result is FALSE and any errors can be retrieved through the getErrors() method.

Parameters
object$argumentsThe arguments object that should be validated
Exceptions

Definition at line 33 of file ArgumentsValidator.php.

References TYPO3\CMS\Extbase\Validation\Validator\AbstractValidator\$result, and TYPO3\CMS\Extbase\Mvc\Controller\ArgumentsValidator\isPropertyValid().