public static function convertToArray(\Symfony\Component\Form\Form $form) {
        //The array of errors messages
        $errors = array();
        $errors['errors'] = array();
        $errors['children'] = array();

        //Get the errors for this level
        foreach($form->getErrors() as $error) {
            $errors['errors'][] = $error->getMessage();
        }

        //Check the errors foreach of this level's children
        foreach($form->all() as $name => $child) {
            //If the child is an instance of \Symfony\Component\Form\Form
            if ($child instanceof \Symfony\Component\Form\Form) {
                //If the child has errors call the convertToArray
                $errors['children'][$name] = self::convertToArray($child);
            }
        }

        //Return the errors array
        return $errors;
    }