protected function searchCorrectMenuEntryInArray($menuEntries)
    {
        foreach ($menuEntries as $key => $menuEntry) {
            if (trim($menuEntry->getTarget(), '/') === trim($this->framework->getRequest()->getRoute(), '/')) {
                return $menuEntry;
            }
            
            if ($menuEntry->hasChildren()) {
                $menuEntry = $this->searchCorrectMenuEntryInArray($menuEntry->getChildren());
                
                if ($menuEntry !== false) {
                    return $menuEntry;
                }
            }
        }
        
        return false;
    }