Neos\Neos\TypoScript\MenuImplementation::isOnLastLevelOfMenu PHP Method

isOnLastLevelOfMenu() protected method

Checks if the given menuItem is on the last level for this menu, either defined by maximumLevels or lastLevels.
protected isOnLastLevelOfMenu ( Neos\ContentRepository\Domain\Model\NodeInterface $menuItemNode ) : boolean
$menuItemNode Neos\ContentRepository\Domain\Model\NodeInterface
return boolean
    protected function isOnLastLevelOfMenu(NodeInterface $menuItemNode)
    {
        if ($this->currentLevel >= $this->getMaximumLevels()) {
            return true;
        }
        if ($this->getLastLevel() !== null) {
            if ($this->getNodeLevelInSite($menuItemNode) >= $this->calculateNodeDepthFromRelativeLevel($this->getLastLevel(), $this->currentNode)) {
                return true;
            }
        }
        return false;
    }