src/Sulu/Component/Content/Types/ResourceLocator/Mapper/PhpcrMapper.php
private function iterateRouteNodes(
        NodeInterface $node,
        $callback,
        $webspaceKey,
        $languageCode,
        $segmentKey = null
    ) {
        if ($node->isNew()) {
            return null;
        }

        $routePath = $this->sessionManager->getRoutePath($webspaceKey, $languageCode);

        // search for references with name 'content'
        foreach ($node->getReferences('sulu:content') as $ref) {
            if ($ref instanceof \PHPCR\PropertyInterface) {
                $routeNode = $ref->getParent();
                if (0 !== strpos($routeNode->getPath(), $routePath)) {
                    continue;
                }

                $resourceLocator = $this->getResourceLocator(
                    $ref->getParent()->getPath(),
                    $webspaceKey,
                    $languageCode,
                    $segmentKey
                );

                $result = $callback($resourceLocator, $routeNode);
                if (false !== $result) {
                    return $result;
                }
            }
        }

        return null;
    }
private function iterateRouteNodes(
        NodeInterface $node,
        $callback,
        $webspaceKey,
        $languageCode,
        $segmentKey = null
    ) {
        if ($node->isNew()) {
            return null;
        }

        $routePath = $this->sessionManager->getRoutePath($webspaceKey, $languageCode);

        // search for references with name 'content'
        foreach ($node->getReferences('sulu:content') as $ref) {
            if ($ref instanceof \PHPCR\PropertyInterface) {
                $routeNode = $ref->getParent();
                if (0 !== strpos($routeNode->getPath(), $routePath)) {
                    continue;
                }

                $resourceLocator = $this->getResourceLocator(
                    $ref->getParent()->getPath(),
                    $webspaceKey,
                    $languageCode,
                    $segmentKey
                );

                $result = $callback($resourceLocator, $routeNode);
                if (false !== $result) {
                    return $result;
                }
            }
        }

        return null;
    }
private function iterateRouteNodes ( NodeInterface $ node , $ callback , $ webspaceKey , $ languageCode , $ segmentKey = null ) { if ( $ node -> isNew ( ) ) { return null ; } $ routePath = $ this -> sessionManager -> getRoutePath ( $ webspaceKey , $ languageCode ) ; // search for references with name 'content' foreach ( $ node -> getReferences ( 'sulu:content' ) as $ ref ) { if ( $ ref instanceof \ PHPCR \ PropertyInterface ) { $ routeNode = $ ref -> getParent ( ) ; if ( 0 !== strpos ( $ routeNode -> getPath ( ) , $ routePath ) ) { continue ; } $ resourceLocator = $ this -> getResourceLocator ( $ ref -> getParent ( ) -> getPath ( ) , $ webspaceKey , $ languageCode , $ segmentKey ) ; $ result = $ callback ( $ resourceLocator , $ routeNode ) ; if ( false !== $ result ) { return $ result ; } } } return null ; }
Iterates over all route nodes assigned by the given node, and executes the callback on it.

@param NodeInterface $node
@param callable $callback will be called foreach route node (stops and return value if not false)
@param string $webspaceKey
@param string $languageCode
@param string $segmentKey

@return \PHPCR\NodeInterface
Iterates over all route nodes assigned by the given node and executes the callback on it .