Neos\Neos\Fusion\MenuImplementation::buildMenuItemRecursive PHP Method

buildMenuItemRecursive() protected method

Prepare the menu item with state and sub items if this isn't the last menu level.
protected buildMenuItemRecursive ( Neos\ContentRepository\Domain\Model\NodeInterface $currentNode ) : array
$currentNode Neos\ContentRepository\Domain\Model\NodeInterface
return array
    protected function buildMenuItemRecursive(NodeInterface $currentNode)
    {
        if ($this->isNodeHidden($currentNode)) {
            return null;
        }
        $item = array('node' => $currentNode, 'state' => self::STATE_NORMAL, 'label' => $currentNode->getLabel(), 'menuLevel' => $this->currentLevel);
        $item['state'] = $this->calculateItemState($currentNode);
        if (!$this->isOnLastLevelOfMenu($currentNode)) {
            $this->currentLevel++;
            $item['subItems'] = $this->buildMenuLevelRecursive($currentNode->getChildNodes($this->getFilter()));
            $this->currentLevel--;
        }
        return $item;
    }