Return a menu entry's named child.

@param string $name

@return MenuEntry
519237
public function get($name)
    {
        if (isset($this->children[$name])) {
            return $this->children[$name];
        }

        throw new \InvalidArgumentException(sprintf('Menu entry %s does not have a child named "%s"', $this->name, $name));
    }
1085308
public function getMemoEntryId($name) {
        return isset($this->memoEntries[$name]) ? $this->memoEntries[$name] : null;
    }
566700
public function getMenu(string $name): MenuItemInterface
    {
        if (array_key_exists($name, $this->builders)) {
            if (!array_key_exists($name, $this->menu)) {
                $this->menu[$name] = $this->builders[$name]->build();
            }

            return $this->menu[$name];
        }

        throw new InvalidMenuNameException(sprintf('Menu %s doesn\'t exist', $name));
    }
526237
public static function init($name)
    {
        if (empty(self::$instance[$name]) || !self::$instance[$name] instanceof self) {
            self::$instance[$name]        = new self();
            self::$instance[$name]->queue = new \SplQueue();
        }
        return self::$instance[$name];
    }
456970
public function getChild($name)
    {
        $principalInfo = $this->principalBackend->getPrincipalByPath($this->principalPrefix.'/'.$name);
        if (!$principalInfo) {
            throw new DAV\Exception\NotFound('Principal with name '.$name.' not found');
        }

        return $this->getChildForPrincipal($principalInfo);
    }
487845
public function getMenu($menuName)
    {
        $menu = $this->getMenuObject($menuName);
        if ($menu) {
            return $menu;
        } else {
            return $this->add($menuName);
        }
    }
923377
public function findChildrenByParentName($name)
    {
        $parent = $this->findOneByName($name);

        return $this->findChildrenByParentId($parent->getId());
    }
1157912
public function add(MenuEntry $menu)
    {
        $menu->parent = $this;
        $menu->urlGenerator = $this->urlGenerator;
        $this->children[$menu->getName()] = $menu;

        return $menu;
    }
962700
public function getParentTargetName(string $name)
    {
        if (empty($this->parentAliases[$name])) {
            return $name;
        }
        return $this->parentAliases[$name];
    }
1019089
public function getSubMenu($menuName, $level = 1)
    {
        $currentParent = false;

        $mainMenuIterator = $this->getFullMenu($menuName);

        if (!$mainMenuIterator) {
            return false;
        }

        foreach ($mainMenuIterator as $menuItem) {
            if ($this->currentPath === $menuItem->getPath()
                || $this->currentPath === $menuItem->getInternalUrl()
            ) {
                $currentParent = $menuItem->getParentByLevel($level);
            }
        }

        if (!$currentParent) {
            return false;
        }

        $menuIterator = $this->menuManager->getChildrenByStatus(
            $currentParent,
            false,
            null,
            'ASC',
            false,
            $this->viewStatus
        );

        return $menuIterator;
    }
1124655
public function getSlotClosure($name)
    {
        if (false === $this->hasSlot($name)) {
            throw EntryNotFoundException::slotClosureSlotNotFound($name);
        }

        return $this->closures[$name];
    }
688013
public function findByName($name)
    {
        $this->loadMenus();

        $rootId = 0;
        if (0 < strpos($name, ':')) {
            list($rootName, $name) = explode(':', $name);
            if (null === $root = $this->findByName($rootName)) {
                throw new \InvalidArgumentException(sprintf('Root menu "%s" not found.', $rootName));
            }
            $rootId = intval($root['id']);
        }

        foreach ($this->menus as $menu) {
            if ($menu['name'] === $name && !(0 < $rootId && intval($menu['root']) != $rootId)) {
                return $menu;
            }
        }

        return null;
    }
593297
public function getChild(string $name): NodeInterface
    {
        if (!isset($this->nodeChildren[$name])) {
            throw new NotFoundException($name);
        }

        return $this->nodeChildren[$name];
    }
1200536
protected function getParentName($name)
    {
        return (string) substr($name, 0, (int) strrpos($name, $this->separator));
    }
1333054
public function getMenuItems($name, $lang)
    {
        /** @var MenuItem $menuRepo */
        $arrayResult = $this->repository->getMenuItemsForLanguage($name, $lang);

        // Make sure the parent item is not offline
        $foundIds = array();
        foreach ($arrayResult as $array) {
            $foundIds[] = $array['id'];
        }
        foreach ($arrayResult as $key => $array) {
            if (!is_null($array['parent']) && !in_array($array['parent']['id'], $foundIds)) {
                unset($arrayResult[$key]);
            }
        }

        return $arrayResult;
    }
119258
public function getMenu(string $name): Menu
    {
        if (!$this->hasMenu($name)) {
            throw new Exception('Invalid menu name "'.$name.'"');
        }

        return $this->menus[$name];
    }
318091
public function addMenu($name)
    {
        if (is_array($name)) {
            $label = $name[0];
            unset($name[0]);
        } else {
            $label = $name;
            $name = [];
        }

        $sub_menu = $this->add([new self(), 'defaultTemplate' => 'submenu.html', 'ui' => 'dropdown', 'in_dropdown' => true]);
        $sub_menu->set('label', $label);

        if (isset($name['icon']) && $name['icon']) {
            $sub_menu->add(new Icon($name['icon']), 'Icon')->removeClass('item');
        }

        if (!$this->in_dropdown) {
            $sub_menu->js(true)->dropdown(['on' => 'hover', 'action' => 'hide']);
        }

        return $sub_menu;
    }