NavigationItem: Add method setParent() and getParent()

refs #5600
This commit is contained in:
Johannes Meyer 2015-09-02 15:30:35 +02:00
parent e2beb7d027
commit 2bfeb335a5
1 changed files with 26 additions and 3 deletions

View File

@ -69,11 +69,11 @@ class NavigationItem implements Countable, IteratorAggregate
protected $label; protected $label;
/** /**
* Parent * This item's parent
* *
* @var NavigationItem|null * @var NavigationItem
*/ */
private $parent; protected $parent;
/** /**
* URL * URL
@ -326,6 +326,29 @@ class NavigationItem implements Countable, IteratorAggregate
return $this; 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 * Return this item's label
* *