public function getContext() { return $this->context; }
/** * {@inheritdoc} * * @param FlowQuery $flowQuery the FlowQuery object * @param array $arguments the arguments for this operation * @return void */ public function evaluate(FlowQuery $flowQuery, array $arguments) { $output = array(); $outputNodePaths = array(); $until = array(); foreach ($flowQuery->getContext() as $contextNode) { $nextNodes = $this->getNextForNode($contextNode); if (isset($arguments[0]) && !empty($arguments[0])) { $untilQuery = new FlowQuery($nextNodes); $untilQuery->pushOperation('filter', array($arguments[0])); $until = $untilQuery->get(); } if (isset($until[0]) && !empty($until[0])) { $nextNodes = $this->getNodesUntil($nextNodes, $until[0]); } if (is_array($nextNodes)) { foreach ($nextNodes as $nextNode) { if ($nextNode !== null && !isset($outputNodePaths[$nextNode->getPath()])) { $outputNodePaths[$nextNode->getPath()] = true; $output[] = $nextNode; } } } } $flowQuery->setContext($output); if (isset($arguments[1]) && !empty($arguments[1])) { $flowQuery->pushOperation('filter', array($arguments[1])); } }