diff --git a/src/Symfony/Component/Form/Button.php b/src/Symfony/Component/Form/Button.php index b72e6ae9ee0c6..cd85aa57cf4b1 100644 --- a/src/Symfony/Component/Form/Button.php +++ b/src/Symfony/Component/Form/Button.php @@ -193,6 +193,22 @@ public function getErrors($deep = false, $flatten = true) return new FormErrorIterator($this, array()); } + /** + * {@inheritdoc} + */ + public function getAllErrors() + { + return $this->getErrors(); + } + + /** + * {@inheritdoc} + */ + public function getOnlyGlobalErrors() + { + return $this->getErrors(); + } + /** * Unsupported method. * diff --git a/src/Symfony/Component/Form/Form.php b/src/Symfony/Component/Form/Form.php index 26b966c72e027..3c64621fa74de 100644 --- a/src/Symfony/Component/Form/Form.php +++ b/src/Symfony/Component/Form/Form.php @@ -800,6 +800,22 @@ public function getErrors($deep = false, $flatten = true) return new FormErrorIterator($this, $errors); } + /** + * {@inheritdoc} + */ + public function getAllErrors() + { + return $this->getErrors(true); + } + + /** + * {@inheritdoc} + */ + public function getOnlyGlobalErrors() + { + return $this->getErrors(); + } + /** * {@inheritdoc} * diff --git a/src/Symfony/Component/Form/FormInterface.php b/src/Symfony/Component/Form/FormInterface.php index a0e9b636c5f38..c9ef72755d5f4 100644 --- a/src/Symfony/Component/Form/FormInterface.php +++ b/src/Symfony/Component/Form/FormInterface.php @@ -103,6 +103,24 @@ public function all(); */ public function getErrors($deep = false, $flatten = true); + /** + * Returns the list of the current form and all child forms. + * + * @return FormErrorIterator An iterator over the {@link FormError} + * instances that where added to the form + * and the child forms + */ + public function getAllErrors(); + + /** + * Returns the list of this form only - without child errors. + * + * @return FormErrorIterator An iterator over the {@link FormError} + * instances that where added to the top + * level of this form + */ + public function getOnlyGlobalErrors(); + /** * Updates the form with default data. *