From 2669e8e11bb357b8af347f75dd3a533996bd1ff1 Mon Sep 17 00:00:00 2001 From: Roland Franssen Date: Sun, 30 Oct 2016 21:32:34 +0100 Subject: [PATCH] added FormView::getRoot --- src/Symfony/Component/Form/FormView.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Symfony/Component/Form/FormView.php b/src/Symfony/Component/Form/FormView.php index 401288cf83d91..4cc29c6308234 100644 --- a/src/Symfony/Component/Form/FormView.php +++ b/src/Symfony/Component/Form/FormView.php @@ -153,4 +153,14 @@ public function count() { return count($this->children); } + + /** + * Get the root view + * + * @return FormView the root view + */ + public function getRoot() + { + return null !== $this->parent ? $this->parent->getRoot() : $this; + } }