From 2bfeb335a5713438dc050097728d8c7dd190d2cd Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Wed, 2 Sep 2015 15:30:35 +0200 Subject: [PATCH] NavigationItem: Add method setParent() and getParent() refs #5600 --- .../Icinga/Web/Navigation/NavigationItem.php | 29 +++++++++++++++++-- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/library/Icinga/Web/Navigation/NavigationItem.php b/library/Icinga/Web/Navigation/NavigationItem.php index d05229dcb..634bd6e64 100644 --- a/library/Icinga/Web/Navigation/NavigationItem.php +++ b/library/Icinga/Web/Navigation/NavigationItem.php @@ -69,11 +69,11 @@ class NavigationItem implements Countable, IteratorAggregate protected $label; /** - * Parent + * This item's parent * - * @var NavigationItem|null + * @var NavigationItem */ - private $parent; + protected $parent; /** * URL @@ -326,6 +326,29 @@ class NavigationItem implements Countable, IteratorAggregate return $this; } + /** + * Set this item's parent + * + * @param NavigationItem $parent + * + * @return $this + */ + public function setParent(NavigationItem $parent) + { + $this->parent = $parent; + return $this; + } + + /** + * Return this item's parent + * + * @return NavigationItem + */ + public function getParent() + { + return $this->parent; + } + /** * Return this item's label *