private function loadMenu($name)
    {
        if ($name instanceof Menu) {
            return $name;
        }

        $menu = $this->menuRepository->findOneBy(array('name' => $name));

        if (!$menu) {
            throw new \RuntimeException(sprintf('Unable to load menu "%s"', $name));
        }

        return $menu;
    }