Validator/ConstraintViolationMapper.php
protected function mapMessagesToElement(array $messages, ElementInterface $element)
    {
        if ($element->hasPropertyPath()) {
            $propertyPathParts = explode('.', $element->getPropertyPath(false));
            $propertyPath      = $this->buildPath($propertyPathParts);
            if ($this->propertyAccessor->isReadable($messages, $propertyPath)) {
                $errors = $this->propertyAccessor->getValue($messages, $propertyPath);
                $element->setError($errors);
            }
        }

        $children = $element->getChildren();

        if ($children->count()) {
            $this->mapMessagesToElementCollection($messages, $children);
        }
    }
protected function mapMessagesToElement(array $messages, ElementInterface $element)
    {
        if ($element->hasPropertyPath()) {
            $propertyPathParts = explode('.', $element->getPropertyPath(false));
            $propertyPath      = $this->buildPath($propertyPathParts);
            if ($this->propertyAccessor->isReadable($messages, $propertyPath)) {
                $errors = $this->propertyAccessor->getValue($messages, $propertyPath);
                $element->setError($errors);
            }
        }

        $children = $element->getChildren();

        if ($children->count()) {
            $this->mapMessagesToElementCollection($messages, $children);
        }
    }
protected function mapMessagesToElement ( array $ messages , ElementInterface $ element ) { if ( $ element -> hasPropertyPath ( ) ) { $ propertyPathParts = explode ( '.' , $ element -> getPropertyPath ( false ) ) ; $ propertyPath = $ this -> buildPath ( $ propertyPathParts ) ; if ( $ this -> propertyAccessor -> isReadable ( $ messages , $ propertyPath ) ) { $ errors = $ this -> propertyAccessor -> getValue ( $ messages , $ propertyPath ) ; $ element -> setError ( $ errors ) ; } } $ children = $ element -> getChildren ( ) ; if ( $ children -> count ( ) ) { $ this -> mapMessagesToElementCollection ( $ messages , $ children ) ; } }
Sets errors on element

@param array            $messages
@param ElementInterface $element
Sets errors on element