PHP Class Neos\Flow\Validation\Validator\GenericObjectValidator

Inheritance: extends AbstractValidator, implements Neos\Flow\Validation\Validator\ObjectValidatorInterface
Afficher le fichier Open project: neos/flow-development-collection Class Usage Examples

Protected Properties

Свойство Type Description
$propertyValidators array
$validatedInstancesContainer SplObjectStorage

Méthodes publiques

Méthode Description
addPropertyValidator ( string $propertyName, Neos\Flow\Validation\Validator\ValidatorInterface $validator ) : void Adds the given validator for validation of the specified property.
getPropertyValidators ( string $propertyName = null ) : array Returns all property validators - or only validators of the specified property
setValidatedInstancesContainer ( SplObjectStorage $validatedInstancesContainer ) : void Allows to set a container to keep track of validated instances.
validate ( mixed $value ) : Neos\Error\Messages\Result Checks if the given value is valid according to the validator, and returns the Error Messages object which occurred.

Méthodes protégées

Méthode Description
checkProperty ( mixed $value, array $validators ) : null | Neos\Error\Messages\Result Checks if the specified property of the given object is valid, and adds found errors to the $messages object.
getPropertyValue ( object $object, string $propertyName ) : mixed Load the property value to be used for validation.
isValid ( mixed $object ) : void Checks if the given value is valid according to the property validators.
isValidatedAlready ( object $object ) : boolean

Method Details

addPropertyValidator() public méthode

Adds the given validator for validation of the specified property.
public addPropertyValidator ( string $propertyName, Neos\Flow\Validation\Validator\ValidatorInterface $validator ) : void
$propertyName string Name of the property to validate
$validator Neos\Flow\Validation\Validator\ValidatorInterface The property validator
Résultat void

checkProperty() protected méthode

Checks if the specified property of the given object is valid, and adds found errors to the $messages object.
protected checkProperty ( mixed $value, array $validators ) : null | Neos\Error\Messages\Result
$value mixed The value to be validated
$validators array The validators to be called on the value
Résultat null | Neos\Error\Messages\Result

getPropertyValidators() public méthode

Returns all property validators - or only validators of the specified property
public getPropertyValidators ( string $propertyName = null ) : array
$propertyName string Name of the property to return validators for
Résultat array An array of validators

getPropertyValue() protected méthode

In case the object is a doctrine proxy, we need to load the real instance first.
protected getPropertyValue ( object $object, string $propertyName ) : mixed
$object object
$propertyName string
Résultat mixed

isValid() protected méthode

Checks if the given value is valid according to the property validators.
protected isValid ( mixed $object ) : void
$object mixed The value that should be validated
Résultat void

isValidatedAlready() protected méthode

protected isValidatedAlready ( object $object ) : boolean
$object object
Résultat boolean

setValidatedInstancesContainer() public méthode

Allows to set a container to keep track of validated instances.
public setValidatedInstancesContainer ( SplObjectStorage $validatedInstancesContainer ) : void
$validatedInstancesContainer SplObjectStorage A container to keep track of validated instances
Résultat void

validate() public méthode

Checks if the given value is valid according to the validator, and returns the Error Messages object which occurred.
public validate ( mixed $value ) : Neos\Error\Messages\Result
$value mixed The value that should be validated
Résultat Neos\Error\Messages\Result

Property Details

$propertyValidators protected_oe property

protected array $propertyValidators
Résultat array

$validatedInstancesContainer protected_oe property

protected SplObjectStorage $validatedInstancesContainer
Résultat SplObjectStorage