TYPO3  7.6
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
AbstractValidator Class Reference
Inheritance diagram for AbstractValidator:
ValidatorInterface AlphanumericValidator BooleanValidator DateTimeValidator EmailAddressValidator FloatValidator GenericObjectValidator IntegerValidator NotEmptyValidator NumberRangeValidator NumberValidator RawValidator RegularExpressionValidator StringLengthValidator StringValidator TextValidator AbstractValidator ValidationElementValidator

Public Member Functions

 __construct (array $options=array())
 
 validate ($value)
 
 getOptions ()
 

Protected Member Functions

 isValid ($value)
 
 addError ($message, $code, array $arguments=array(), $title= '')
 
 isEmpty ($value)
 
 translateErrorMessage ($translateKey, $extensionName, $arguments=array())
 

Protected Attributes

 $acceptsEmptyValues = true
 
 $supportedOptions = array()
 
 $options = array()
 
 $result
 

Detailed Description

Abstract validator

Definition at line 22 of file extbase/Classes/Validation/Validator/AbstractValidator.php.

Constructor & Destructor Documentation

__construct ( array  $options = array())

Constructs the validator and sets validation options

Parameters
array$optionsOptions for the validator
Exceptions
InvalidValidationOptionsException

Definition at line 59 of file extbase/Classes/Validation/Validator/AbstractValidator.php.

References AbstractValidator\$options, and AbstractValidator\$supportedOptions.

Member Function Documentation

addError (   $message,
  $code,
array  $arguments = array(),
  $title = '' 
)
protected
getOptions ( )

Returns the options of this validator

Returns
array

Implements ValidatorInterface.

Definition at line 134 of file extbase/Classes/Validation/Validator/AbstractValidator.php.

References AbstractValidator\$options.

isEmpty (   $value)
finalprotected
Parameters
mixed$value
Returns
bool TRUE if the given $value is NULL or an empty string ('')

Definition at line 143 of file extbase/Classes/Validation/Validator/AbstractValidator.php.

Referenced by GenericObjectValidator\validate(), ValidationElementValidator\validate(), CollectionValidator\validate(), and AbstractValidator\validate().

isValid (   $value)
abstractprotected

Check if $value is valid. If it is not valid, needs to add an error to result.

Parameters
mixed$value
Returns
void

Referenced by AbstractValidator\validate().

translateErrorMessage (   $translateKey,
  $extensionName,
  $arguments = array() 
)
protected
validate (   $value)

Checks if the given value is valid according to the validator, and returns the error messages object which occurred.

Parameters
mixed$valueThe value that should be validated
Returns

Implements ValidatorInterface.

Definition at line 97 of file extbase/Classes/Validation/Validator/AbstractValidator.php.

References AbstractValidator\$result, AbstractValidator\isEmpty(), and AbstractValidator\isValid().

Member Data Documentation

$acceptsEmptyValues = true
protected
$options = array()
protected
$result
protected
$supportedOptions = array()
protected