Get a menu you have created.

@param $menuName

@return mixed
487845
public function getMenu($menuName)
    {
        $menu = $this->getMenuObject($menuName);
        if ($menu) {
            return $menu;
        } else {
            return $this->add($menuName);
        }
    }
806097
function create_menu($menu){
    
        $url = self::API_URI . self::MENU_CREATE;
        $param['access_token'] = $this->access_token;
        $menu_url = $this->create_url($url, $param);
    
        $fields = self::json_encode($menu);
        $data = $this->http_post($menu_url, $fields);
        return $this->return_data($data);
    
    }
1374812
public function buildMenuFromOpmlFile( $fileName )
	{
		$list	= Alg_Tree_Menu_Converter::convertFromOpmlFile( $fileName, $this->rootLabel );
		return $this->buildMenuFromMenuList( $list );
	}
1233301
public function getMenu()
    {
        return $this->auth(function () {
            return $this->http->getJson($this->baseUrl . 'cgi-bin/menu/get?access_token=' . $this->accessToken);
        });
    }
1057942
public function get($name, array $options = [])
    {
        if (null === $menu = $this->findByName($name)) {
            throw new \InvalidArgumentException(sprintf('The menu "%s" is not defined.', $name));
        }

        return $this->buildItem($menu, array_merge([
            'attributes' => ['id' => $menu['name'] . '-nav'] // Root css id
        ], $options));
    }
1196191
public function getAttribute(string $name)
    {
        $method = 'get'.\ucfirst($name).'Attribute';
        $value = $this->menu[$name] ?? null;

        if (\method_exists($this, $method)) {
            return $this->container->call([$this, $method], ['value' => $value]);
        }

        return $value;
    }
322515
public function getMenu()
    {
        $this->buildMenu();
        $this->applyEdits();
        $this->applyRemoves();
        $this->applyRenames();
        $this->applyOrdering();
        return $this->menu;
    }
400723
public function getMenu($key)
    {
        if (is_array($key)) {
            $menu_items = $key;
        } else {
            $menu_items = explode(',', $key);
        }

        // Comma-deliminated string requested.
        if (count($menu_items) > 1 || is_array($key)) {
            $result = collect();

            foreach ($menu_items as $key) {
                $menu = $this->menu_collection->get($key);

                if (is_null($menu)) {
                    continue;
                }

                foreach ($menu->all() as $item) {
                    $result->push($item);
                }
            }

            // Create new menu and return.
            return new Menu($key, $result);
        }

        return $this->menu_collection->get($key);
    }
676895
private function menuBuilder(array $menu)
    {
        foreach ($menu as $key => $item) {
            $menu[$key] = $this->menuHelper($item);
            if (isset($item['submenu'])) {
                $menu[$key]['submenu'] = $this->menuBuilder($item['submenu']);
            }
        }

        return $menu;
    }
406157
public function renderMenu(Request $request, string $menuName): Response
    {
        $menu = $this->menuProvider->get($menuName);
        $menu->setChildrenAttribute('class', $request->attributes->get('ulClass') ?: 'nav navbar-nav');

        $menuOptions = [
            'firstClass' => $request->attributes->get('firstClass') ?: 'firstli',
            'currentClass' => $request->attributes->get('currentClass') ?: 'active',
            'lastClass' => $request->attributes->get('lastClass') ?: 'lastli',
            'template' => $this->getConfigResolver()->getParameter('template.menu', 'ngsite'),
        ];

        if ($request->attributes->has('template')) {
            $menuOptions['template'] = $request->attributes->get('template');
        }

        $response = new Response();

        $menuLocationId = $menu->getAttribute('location-id');
        if (!empty($menuLocationId)) {
            $this->tagHandler->addTags(['location-' . $menuLocationId]);
        }

        $this->processCacheSettings($request, $response);

        $response->setContent($this->menuRenderer->get()->render($menu, $menuOptions));

        return $response;
    }
558095
public function create($menu = null)
    {
        $model = $this->repository->getModel();

        return view('menulinks::admin.create')
            ->with(compact('model', 'menu'));
    }
508911
public function render($menuName)
    {
        // We set active at the last possible moment.
        $this->updateActive();

        $menu = $this->getMenuObject($menuName);

        if (! $menu) {
            throw new \Exception("Menu {$menuName} not found.");
        }

        return $menu;
    }
1203011
public function newMenuItemAction(Menu $menu)
    {
        $em = $this->getDoctrine()->getManager();

        $entity = new MenuItem();
        $entity->setMenu($menu);
        $form = $this->createMenuItemCreateForm($entity);

        return array(
            'entity' => $entity,
            'form' => $form->createView(),
        );
    }
989211
public function getMenu($name = 'default')
    {
        $this->initialize();
        if (!isset($this->menus[$name])) {
            throw new MenuDoesNotExistException(sprintf('Menu %s does not exist', $name));
        }

        return $this->menus[$name];
    }
624922
private function getOption(string $functionName)
    {
        if (!array_key_exists($functionName, $this->optionsCache)) {
            $this->optionsCache[$functionName] = $this->parentOptions->{$functionName}();
        }

        return $this->optionsCache[$functionName];
    }
1185979
public function menu($name = 'default')
    {
        if (!isset($this->menus[$name])) {
            $this->menus[$name] = new Menu($this);
        }

        return $this->menus[$name];
    }
211164
public function getMenus()
    {
        $this->menus || $this->menus = wei()->menu()->notDeleted()->findAll(['categoryId' => $this['id']]);

        return $this->menus;
    }