Neos\ContentRepository\Eel\FlowQueryOperations\NextOperation::evaluate PHP Method

evaluate() public method

public evaluate ( FlowQuery $flowQuery, array $arguments ) : void
$flowQuery Neos\Eel\FlowQuery\FlowQuery the FlowQuery object
$arguments array the arguments for this operation
return void
    public function evaluate(FlowQuery $flowQuery, array $arguments)
    {
        $output = array();
        $outputNodePaths = array();
        foreach ($flowQuery->getContext() as $contextNode) {
            $nextNode = $this->getNextForNode($contextNode);
            if ($nextNode !== null && !isset($outputNodePaths[$nextNode->getPath()])) {
                $outputNodePaths[$nextNode->getPath()] = true;
                $output[] = $nextNode;
            }
        }
        $flowQuery->setContext($output);
        if (isset($arguments[0]) && !empty($arguments[0])) {
            $flowQuery->pushOperation('filter', $arguments);
        }
    }