diff --git a/library/Icinga/Web/Navigation/NavigationItem.php b/library/Icinga/Web/Navigation/NavigationItem.php index 95f7e982b..a94b5fd8c 100644 --- a/library/Icinga/Web/Navigation/NavigationItem.php +++ b/library/Icinga/Web/Navigation/NavigationItem.php @@ -244,9 +244,9 @@ class NavigationItem implements Countable, IteratorAggregate } /** - * Get the item's children + * Return this item's children * - * @return Navigation + * @return Navigation */ public function getChildren() { @@ -264,7 +264,7 @@ class NavigationItem implements Countable, IteratorAggregate } /** - * Set children + * Set this item's children * * @param array|Navigation $children * @@ -278,6 +278,10 @@ class NavigationItem implements Countable, IteratorAggregate throw new InvalidArgumentException('Argument $children must be of type array or Navigation'); } + foreach ($children as $item) { + $item->setParent($this); + } + $this->children = $children; return $this; }