Menu/MainMenuBuilder.php
public function getSideMenu($factory, $helper)
    {
        $menu = $factory->createItem('root');

        if ($helper->isUserLogged()) {
            // Admin menu
            if ($this->provider->has('imatic.admin')) {
                $menu->addChild($this->provider->get('imatic.admin'));
            }
            // User menu - user functions
            if ($this->provider->has('imatic.user')) {
                $helper->addDivider($menu, true);
                $menu->addChild($this->provider->get('imatic.user'));
            }
        } else {
            // User menu - login link
            if ($this->provider->has('imatic.user_anon')) {
                $helper->addDivider($menu, true);
                $menu->addChild($this->provider->get('imatic.user_anon'));
            }
        }

        return $menu;
    }
public function getSideMenu($factory, $helper)
    {
        $menu = $factory->createItem('root');

        if ($helper->isUserLogged()) {
            // Admin menu
            if ($this->provider->has('imatic.admin')) {
                $menu->addChild($this->provider->get('imatic.admin'));
            }
            // User menu - user functions
            if ($this->provider->has('imatic.user')) {
                $helper->addDivider($menu, true);
                $menu->addChild($this->provider->get('imatic.user'));
            }
        } else {
            // User menu - login link
            if ($this->provider->has('imatic.user_anon')) {
                $helper->addDivider($menu, true);
                $menu->addChild($this->provider->get('imatic.user_anon'));
            }
        }

        return $menu;
    }
@param Factory $factory
@param Helper  $helper

@return \Knp\Menu\ItemInterface