private function addActiveStateToNavigation($navigation, $depth = 0)
{
$selectedKeys = $this->getSelectedKeys();
foreach ($navigation as $key => &$item) {
if ($key == $selectedKeys[$depth]) {
$item['active'] = true;
if (!empty($item['children'])) {
$item['children'] = $this->addActiveStateToNavigation($item['children'], $depth + 1);
}
}
}
return $navigation;
}