Neos\ContentRepository\Eel\FlowQueryOperations\NextAllOperation::getNextForNode PHP Method

getNextForNode() protected method

protected getNextForNode ( Neos\ContentRepository\Domain\Model\NodeInterface $contextNode ) : Neos\ContentRepository\Domain\Model\NodeInterface
$contextNode Neos\ContentRepository\Domain\Model\NodeInterface The node for which the preceding node should be found
return Neos\ContentRepository\Domain\Model\NodeInterface The preceding nodes of $contextNode or NULL
    protected function getNextForNode(NodeInterface $contextNode)
    {
        $nodesInContext = $contextNode->getParent()->getChildNodes();
        $count = count($nodesInContext);
        for ($i = 0; $i < $count; $i++) {
            if ($nodesInContext[$i] === $contextNode) {
                unset($nodesInContext[$i]);
                return array_values($nodesInContext);
            } else {
                unset($nodesInContext[$i]);
            }
        }
        return null;
    }