Neos\ContentRepository\Eel\FlowQueryOperations\PrevUntilOperation::getPrevForNode PHP Метод

getPrevForNode() защищенный Метод

protected getPrevForNode ( Neos\ContentRepository\Domain\Model\NodeInterface $contextNode ) : array | null
$contextNode Neos\ContentRepository\Domain\Model\NodeInterface The node for which the previous nodes should be found
Результат array | null The previous nodes of $contextNode or NULL
    protected function getPrevForNode(NodeInterface $contextNode)
    {
        $nodesInContext = $contextNode->getParent()->getChildNodes();
        $count = count($nodesInContext) - 1;
        for ($i = $count; $i > 0; $i--) {
            if ($nodesInContext[$i] === $contextNode) {
                unset($nodesInContext[$i]);
                return array_values($nodesInContext);
            } else {
                unset($nodesInContext[$i]);
            }
        }
        return null;
    }