public function hasRecursiveErrorMessages(FormView $formView)
    {
        $errors = $formView->vars['errors'];

        if (is_object($errors) && $errors instanceof \Traversable) {
            $errors = iterator_to_array($errors);
        }

        if (!empty($errors)) {
            return true;
        }

        if ($formView->count()) {
            foreach ($formView->children as $child) {
                if ($this->hasRecursiveErrorMessages($child)) {
                    return true;
                }
            }
        }

        return false;
    }