TYPO3
7.6
|
Public Member Functions | |
validate ($value) | |
canValidate ($object) | |
addPropertyValidator ($propertyName, ValidatorInterface $validator) | |
getPropertyValidators ($propertyName=null) | |
setValidatedInstancesContainer (\SplObjectStorage $validatedInstancesContainer) | |
Public Member Functions inherited from AbstractValidator | |
__construct (array $options=array()) | |
validate ($value) | |
getOptions () | |
Protected Member Functions | |
getPropertyValue ($object, $propertyName) | |
isValid ($object) | |
isValidatedAlready ($object) | |
Protected Member Functions inherited from AbstractValidator | |
isValid ($value) | |
addError ($message, $code, array $arguments=array(), $title= '') | |
isEmpty ($value) | |
translateErrorMessage ($translateKey, $extensionName, $arguments=array()) | |
Protected Attributes | |
$propertyValidators = array() | |
$validatedInstancesContainer | |
Protected Attributes inherited from AbstractValidator | |
$acceptsEmptyValues = true | |
$supportedOptions = array() | |
$options = array() | |
$result | |
A generic object validator which allows for specifying property validators
Definition at line 22 of file GenericObjectValidator.php.
addPropertyValidator | ( | $propertyName, | |
ValidatorInterface | $validator | ||
) |
Adds the given validator for validation of the specified property.
string | $propertyName | Name of the property to validate |
ValidatorInterface | $validator | The property validator |
Definition at line 136 of file GenericObjectValidator.php.
canValidate | ( | $object | ) |
Checks the given object can be validated by the validator implementation
mixed | $object | The object to be checked |
Definition at line 123 of file GenericObjectValidator.php.
getPropertyValidators | ( | $propertyName = null | ) |
Returns all property validators - or only validators of the specified property
string | $propertyName | Name of the property to return validators for |
Definition at line 168 of file GenericObjectValidator.php.
References GenericObjectValidator\$propertyValidators.
|
protected |
Load the property value to be used for validation.
In case the object is a doctrine proxy, we need to load the real instance first.
object | $object | |
string | $propertyName |
Definition at line 60 of file GenericObjectValidator.php.
References ObjectAccess\getProperty(), and ObjectAccess\isPropertyGettable().
Referenced by GenericObjectValidator\isValid().
|
protected |
Checks if the given value is valid according to the property validators.
mixed | $object | The value that should be validated |
Definition at line 108 of file GenericObjectValidator.php.
References GenericObjectValidator\getPropertyValue().
Referenced by GenericObjectValidator\validate().
|
protected |
object | $object |
Definition at line 148 of file GenericObjectValidator.php.
Referenced by GenericObjectValidator\validate(), and CollectionValidator\validate().
setValidatedInstancesContainer | ( | \SplObjectStorage | $validatedInstancesContainer | ) |
Allows to set a container to keep track of validated instances.
\SplObjectStorage | $validatedInstancesContainer | A container to keep track of validated instances |
Implements ObjectValidatorInterface.
Definition at line 189 of file GenericObjectValidator.php.
References GenericObjectValidator\$validatedInstancesContainer.
validate | ( | $value | ) |
Checks if the given value is valid according to the validator, and returns the Error Messages object which occurred.
mixed | $value | The value that should be validated |
Implements ValidatorInterface.
Definition at line 37 of file GenericObjectValidator.php.
References AbstractValidator\$result, AbstractValidator\addError(), elseif, AbstractValidator\isEmpty(), GenericObjectValidator\isValid(), and GenericObjectValidator\isValidatedAlready().
|
protected |
Definition at line 27 of file GenericObjectValidator.php.
Referenced by GenericObjectValidator\getPropertyValidators().
|
protected |
Definition at line 180 of file GenericObjectValidator.php.
Referenced by GenericObjectValidator\setValidatedInstancesContainer().