public function getItemsAtDepth($depth) { $itemsWithDepth = $this->getItemsWithDepth(); if (array_key_exists($depth, $itemsWithDepth)) { return new MenuHandler($itemsWithDepth[$depth]); } return new MenuHandler(array()); }