aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIvan Enderlin <ivan.enderlin@hoa-project.net>2013-11-11 09:01:37 +0100
committerIvan Enderlin <ivan.enderlin@hoa-project.net>2013-11-11 09:01:37 +0100
commitaf293fba3ffab0d8a8d0e353f288ad4ebcfc8dff (patch)
tree00e9e25ddc5ece62fff95f5039519a9a60e38be6
parent09b88c57d1b5b02973a3c23f3096924679b5c7a6 (diff)
downloadPraspel-af293fba3ffab0d8a8d0e353f288ad4ebcfc8dff.zip
Praspel-af293fba3ffab0d8a8d0e353f288ad4ebcfc8dff.tar.gz
Praspel-af293fba3ffab0d8a8d0e353f288ad4ebcfc8dff.tar.bz2
Add the getRoot() method.
-rw-r--r--Model/Clause.php16
1 files changed, 16 insertions, 0 deletions
diff --git a/Model/Clause.php b/Model/Clause.php
index 071db59..83cbd9e 100644
--- a/Model/Clause.php
+++ b/Model/Clause.php
@@ -116,6 +116,22 @@ abstract class Clause implements \Hoa\Visitor\Element {
}
/**
+ * Get the root clause.
+ *
+ * @access public
+ * @return \Hoa\Praspel\Model\Clause
+ */
+ public function getRoot ( ) {
+
+ $parent = $this;
+
+ while(null !== $nextParent = $parent->getParent())
+ $parent = $nextParent;
+
+ return $parent;
+ }
+
+ /**
* Get clause name.
*
* @access public