public function createValidator($validatorType, array $validatorOptions = [])
    {
        try {
            /**
             * @todo remove throwing Exceptions in resolveValidatorObjectName
             */
            $validatorObjectName = $this->resolveValidatorObjectName($validatorType);

            $validator = $this->objectManager->get($validatorObjectName, $validatorOptions);

            if (!($validator instanceof \TYPO3\CMS\Extbase\Validation\Validator\ValidatorInterface)) {
                throw new Exception\NoSuchValidatorException('The validator "' . $validatorObjectName . '" does not implement TYPO3\CMS\Extbase\Validation\Validator\ValidatorInterface!', 1300694875);
            }

            return $validator;
        } catch (NoSuchValidatorException $e) {
            return null;
        }
    }
public function createValidator($validatorType, array $validatorOptions = [])
    {
        try {
            /**
             * @todo remove throwing Exceptions in resolveValidatorObjectName
             */
            $validatorObjectName = $this->resolveValidatorObjectName($validatorType);

            $validator = $this->objectManager->get($validatorObjectName, $validatorOptions);

            if (!($validator instanceof \TYPO3\CMS\Extbase\Validation\Validator\ValidatorInterface)) {
                throw new Exception\NoSuchValidatorException('The validator "' . $validatorObjectName . '" does not implement TYPO3\CMS\Extbase\Validation\Validator\ValidatorInterface!', 1300694875);
            }

            return $validator;
        } catch (NoSuchValidatorException $e) {
            return null;
        }
    }
public function createValidator ( $ validatorType , array $ validatorOptions = [ ] ) { try { /**
             * @todo remove throwing Exceptions in resolveValidatorObjectName
             */ $ validatorObjectName = $ this -> resolveValidatorObjectName ( $ validatorType ) ; $ validator = $ this -> objectManager -> get ( $ validatorObjectName , $ validatorOptions ) ; if ( ! ( $ validator instanceof \ TYPO3 \ CMS \ Extbase \ Validation \ Validator \ ValidatorInterface ) ) { throw new Exception \ NoSuchValidatorException ( 'The validator "' . $ validatorObjectName . '" does not implement TYPO3\CMS\Extbase\Validation\Validator\ValidatorInterface!' , 1300694875 ) ; } return $ validator ; } catch ( NoSuchValidatorException $ e ) { return null ; } }
Get a validator for a given data type. Returns a validator implementing
the \TYPO3\CMS\Extbase\Validation\Validator\ValidatorInterface or NULL if no validator
could be resolved.

@param string $validatorType Either one of the built-in data types or fully qualified validator class name
@param array $validatorOptions Options to be passed to the validator
@return \TYPO3\CMS\Extbase\Validation\Validator\ValidatorInterface Validator or NULL if none found.
Get a validator for a given data type . Returns a validator implementing the \ TYPO3 \ CMS \ Extbase \ Validation \ Validator \ ValidatorInterface or NULL if no validator could be resolved .