Neos\Flow\Validation\Validator\GenericObjectValidator::checkProperty PHP Method

checkProperty() protected method

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
return null | Neos\Error\Messages\Result
    protected function checkProperty($value, $validators)
    {
        $result = null;
        foreach ($validators as $validator) {
            if ($validator instanceof ObjectValidatorInterface) {
                $validator->setValidatedInstancesContainer($this->validatedInstancesContainer);
            }
            $currentResult = $validator->validate($value);
            if ($currentResult->hasMessages()) {
                if ($result === null) {
                    $result = $currentResult;
                } else {
                    $result->merge($currentResult);
                }
            }
        }
        return $result;
    }