src/Sulu/Bundle/WebsiteBundle/Navigation/NavigationMapper.php
public function inNavigation(StructureInterface $content, $context = null)
    {
        $contexts = $content->getNavContexts();

        if (Structure::STATE_PUBLISHED !== $content->getNodeState()) {
            // if node state is not published do not show page
            return false;
        }

        if (is_array($contexts) && (null === $context || in_array($context, $contexts))) {
            // all contexts or content has context
            return true;
        }

        // do not show
        return false;
    }
public function inNavigation(StructureInterface $content, $context = null)
    {
        $contexts = $content->getNavContexts();

        if (Structure::STATE_PUBLISHED !== $content->getNodeState()) {
            // if node state is not published do not show page
            return false;
        }

        if (is_array($contexts) && (null === $context || in_array($context, $contexts))) {
            // all contexts or content has context
            return true;
        }

        // do not show
        return false;
    }
public function inNavigation ( StructureInterface $ content , $ context = null ) { $ contexts = $ content -> getNavContexts ( ) ; if ( Structure :: STATE_PUBLISHED !== $ content -> getNodeState ( ) ) { // if node state is not published do not show page return false ; } if ( is_array ( $ contexts ) && ( null === $ context || in_array ( $ context , $ contexts ) ) ) { // all contexts or content has context return true ; } // do not show return false ; }
checks if content should be displayed.

@param StructureInterface $content
@param string|null $context

@return bool
checks if content should be displayed .