TYPO3
7.6
|
Public Member Functions | |
injectObjectManager (\TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager) | |
injectReflectionService (\TYPO3\CMS\Extbase\Reflection\ReflectionService $reflectionService) | |
createValidator ($validatorType, array $validatorOptions=array()) | |
getBaseValidatorConjunction ($targetClassName) | |
getMethodValidateAnnotations ($className, $methodName) | |
Public Attributes | |
const | PATTERN_MATCH_VALIDATORS |
const | PATTERN_MATCH_VALIDATOROPTIONS |
Protected Member Functions | |
buildSubObjectValidator (array $objectPath,\TYPO3\CMS\Extbase\Validation\Validator\ValidatorInterface $propertyValidator) | |
addCustomValidators ($targetClassName, ConjunctionValidator &$conjunctionValidator) | |
parseValidatorAnnotation ($validateValue) | |
parseValidatorOptions ($rawValidatorOptions) | |
unquoteString (&$quotedValue) | |
resolveValidatorObjectName ($validatorName) | |
getValidatorType ($type) | |
Protected Attributes | |
$objectManager | |
$reflectionService | |
$baseValidatorConjunctions = array() | |
Validator resolver to automatically find an appropriate validator for a given subject
Definition at line 26 of file ValidatorResolver.php.
|
protected |
This adds custom validators to the passed $conjunctionValidator.
A custom validator is found if it follows the naming convention "Replace '\Model\' by '\Validator\' and append 'Validator'". If found, it will be added to the $conjunctionValidator.
In addition canValidate() will be called on all implementations of the ObjectValidatorInterface to find all validators that could validate the target. The one with the highest priority will be added as well. If multiple validators have the same priority, which one will be added is not deterministic.
string | $targetClassName | |
ConjunctionValidator | $conjunctionValidator |
Definition at line 349 of file ValidatorResolver.php.
References AbstractCompositeValidator\addValidator(), ValidatorResolver\createValidator(), and ClassNamingUtility\translateModelNameToValidatorName().
|
protected |
Builds a chain of nested object validators by specification of the given object path.
array | $objectPath | The object path |
\TYPO3\CMS\Extbase\Validation\Validator\ValidatorInterface | $propertyValidator | The validator which should be added to the property specified by objectPath |
Definition at line 226 of file ValidatorResolver.php.
createValidator | ( | $validatorType, | |
array | $validatorOptions = array() |
||
) |
Get a validator for a given data type. Returns a validator implementing the or NULL if no validator could be resolved.
string | $validatorType | Either one of the built-in data types or fully qualified validator class name |
array | $validatorOptions | Options to be passed to the validator |
Definition at line 102 of file ValidatorResolver.php.
References GeneralUtility\devLog(), ValidatorResolver\resolveValidatorObjectName(), and GeneralUtility\SYSLOG_SEVERITY_INFO.
Referenced by ValidatorResolver\addCustomValidators().
getBaseValidatorConjunction | ( | $targetClassName | ) |
Resolves and returns the base validator conjunction for the given data type.
If no validator could be resolved (which usually means that no validation is necessary), NULL is returned.
string | $targetClassName | The data type to search a validator for. Usually the fully qualified object name |
Definition at line 132 of file ValidatorResolver.php.
getMethodValidateAnnotations | ( | $className, | |
$methodName | |||
) |
Temporary replacement for $this->reflectionService->getMethodAnnotations()
string | $className | |
string | $methodName |
Definition at line 527 of file ValidatorResolver.php.
References ValidatorResolver\parseValidatorAnnotation().
|
protected |
Used to map PHP types to validator types.
string | $type | Data type to unify |
Definition at line 495 of file ValidatorResolver.php.
Referenced by ValidatorResolver\resolveValidatorObjectName().
injectObjectManager | ( | \TYPO3\CMS\Extbase\Object\ObjectManagerInterface | $objectManager | ) |
\TYPO3\CMS\Extbase\Object\ObjectManagerInterface | $objectManager |
Definition at line 80 of file ValidatorResolver.php.
References ValidatorResolver\$objectManager.
injectReflectionService | ( | \TYPO3\CMS\Extbase\Reflection\ReflectionService | $reflectionService | ) |
\TYPO3\CMS\Extbase\Reflection\ReflectionService | $reflectionService |
Definition at line 88 of file ValidatorResolver.php.
References ValidatorResolver\$reflectionService.
|
protected |
Parses the validator options given in annotations.
string | $validateValue |
Definition at line 370 of file ValidatorResolver.php.
References ValidatorResolver\parseValidatorOptions().
Referenced by ValidatorResolver\getMethodValidateAnnotations().
|
protected |
Parses $rawValidatorOptions not containing quoted option values. $rawValidatorOptions will be an empty string afterwards (pass by ref!).
string | $rawValidatorOptions |
Definition at line 398 of file ValidatorResolver.php.
Referenced by ValidatorResolver\parseValidatorAnnotation().
|
protected |
Returns an object of an appropriate validator for the given class. If no validator is available FALSE is returned
string | $validatorName | Either the fully qualified class name of the validator or the short name of a built-in validator |
Exception\NoSuchValidatorException |
Definition at line 441 of file ValidatorResolver.php.
References ValidatorResolver\getValidatorType().
Referenced by ValidatorResolver\createValidator().
|
protected |
Removes escapings from a given argument string and trims the outermost quotes.
This method is meant as a helper for regular expression results.
string | &$quotedValue | Value to unquote |
Definition at line 419 of file ValidatorResolver.php.
|
protected |
Definition at line 75 of file ValidatorResolver.php.
|
protected |
Definition at line 65 of file ValidatorResolver.php.
Referenced by ValidatorResolver\injectObjectManager().
|
protected |
Definition at line 70 of file ValidatorResolver.php.
Referenced by ValidatorResolver\injectReflectionService().
const PATTERN_MATCH_VALIDATOROPTIONS |
Definition at line 51 of file ValidatorResolver.php.
const PATTERN_MATCH_VALIDATORS |
Definition at line 34 of file ValidatorResolver.php.