', '>' by default * @return mixed */ public function evaluate(FlowQuery $flowQuery, array $arguments) { if (!isset($arguments[0]) || empty($arguments[0])) { throw new \Neos\Eel\FlowQuery\FlowQueryException('filterByDate() needs property name by which nodes should be filtered', 1332492263); } else if (!isset($arguments[1]) || empty($arguments[1])) { throw new \Neos\Eel\FlowQuery\FlowQueryException('filterByDate() needs date value by which nodes should be filtered', 1332493263); } else { $nodes = $flowQuery->getContext(); $filterByPropertyPath = $arguments[0]; $date = $arguments[1]; $compareOperator = '>'; if (isset($arguments[2]) && !empty($arguments[2]) && in_array($arguments[2], array('<', '>'))) { $compareOperator = $arguments[2]; } $filteredNodes = array(); /** @var Node $node */ foreach ($nodes as $node) { $propertyValue = $node->getProperty($filterByPropertyPath); if ($compareOperator == '>') { if ($propertyValue > $date) { $filteredNodes[] = $node; } } if ($compareOperator == '<') { if ($propertyValue < $date) { $filteredNodes[] = $node; } } } $flowQuery->setContext($filteredNodes); } } }