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;
}