{@inheritdoc}

@param FlowQuery $flowQuery the FlowQuery object
@param array $arguments the arguments for this operation
@return void
@throws FlowQueryException
@throws \Neos\Eel\Exception
545917
public function evaluate(FlowQuery $flowQuery, array $arguments)
    {
        if (!isset($arguments[0]) || empty($arguments[0])) {
            throw new FlowQueryException('closest() requires a filter argument', 1332492263);
        }

        $output = [];
        foreach ($flowQuery->getContext() as $contextNode) {
            $contextNodeQuery = new FlowQuery([$contextNode]);
            $contextNodeQuery->pushOperation('first', []);
            $contextNodeQuery->pushOperation('filter', $arguments);

            $parentsQuery = new FlowQuery([$contextNode]);
            $contextNodeQuery->pushOperation('add', [$parentsQuery->parents($arguments[0])->get()]);

            foreach ($contextNodeQuery as $result) {
                /* @var TraversableNodeInterface $result */
                $output[(string)$result->getNodeAggregateIdentifier()] = $result;
            }
        }

        $flowQuery->setContext(array_values($output));
    }
747816
public function Execute($q, $arguments = [])
    {
        if ($q instanceof \Doctrine\DBAL\Statement) {
            return $q->execute($arguments);
        } else {
            if (!is_array($arguments)) {
                $arguments = [$arguments]; // adodb backward compatibility
            }

            return $this->executeQuery($q, $arguments);
        }
    }
987645
private function setQuery(string $method, array $query, array &$globals, array &$server)
    {
        if ($method === 'get') {
            $globals['_GET'] = $query;

            return;
        }
        if ($method === 'post') {
            $globals['_POST'] = $query;

            return;
        }
        $server = $this->getStdIn($method, $query, $server);
    }
805532
public function execute($query, array $variables = [])
    {
        $this->acceptHeaderValue = 'application/vnd.github.v4+json';
        $params = [
            'query' => $query,
        ];
        if (!empty($variables)) {
            $params['variables'] = json_encode($variables);
        }

        return $this->post('/graphql', $params);
    }
197260
public void setFlowLogs(java.util.Collection<FlowLog> flowLogs) {
        if (flowLogs == null) {
            this.flowLogs = null;
            return;
        }

        this.flowLogs = new com.amazonaws.internal.SdkInternalList<FlowLog>(flowLogs);
    }
408585
public function bind_and_run( $query, $bindings = [] )
	{
		$new_query = $this->bind_params( $query, $bindings );

		$result = $this->db->query( $new_query );

		if ( $result === false || $this->db->last_error ) {
			throw new QueryException( $new_query, $bindings, new \Exception( $this->db->last_error ) );
		}

		return (array) $result;
	}
318144
public function evaluate(FlowQuery $flowQuery, array $arguments)
    {
        list($siteNode, $documentNode) = $flowQuery->getContext();
        list($baseNodeType, $loadingDepth, $toggledNodes, $clipboardNodeContextPath) = $arguments;

        // Collect all parents of documentNode up to siteNode
        $parents = [];
        $currentNode = $documentNode->getParent();
        if ($currentNode) {
            $parentNodeIsUnderneathSiteNode = strpos($currentNode->getPath(), $siteNode->getPath()) === 0;
            while ($currentNode !== $siteNode && $parentNodeIsUnderneathSiteNode) {
                $parents[] = $currentNode->getContextPath();
                $currentNode = $currentNode->getParent();
            }
        }

        $nodes = [$siteNode];
        $gatherNodesRecursively = function (&$nodes, $baseNode, $level = 0) use (&$gatherNodesRecursively, $baseNodeType, $loadingDepth, $toggledNodes, $parents) {
            if (
                $level < $loadingDepth || // load all nodes within loadingDepth
                $loadingDepth === 0 || // unlimited loadingDepth
                in_array($baseNode->getContextPath(), $toggledNodes) || // load toggled nodes
                in_array($baseNode->getContextPath(), $parents) // load children of all parents of documentNode
            ) {
                foreach ($baseNode->getChildNodes($baseNodeType) as $childNode) {
                    $nodes[] = $childNode;
                    $gatherNodesRecursively($nodes, $childNode, $level + 1);
                }
            }
        };
        $gatherNodesRecursively($nodes, $siteNode);

        if (!in_array($documentNode, $nodes)) {
            $nodes[] = $documentNode;
        }

        if ($clipboardNodeContextPath) {
            $clipboardNode = $this->propertyMapper->convert($clipboardNodeContextPath, NodeInterface::class);
            if ($clipboardNode && !in_array($clipboardNode, $nodes)) {
                $nodes[] = $clipboardNode;
            }
        }

        $flowQuery->setContext($nodes);
    }
1192957
public function RunQuery(\Google\Cloud\Datastore\V1\RunQueryRequest $argument,
      $metadata = [], $options = []) {
        return $this->_simpleRequest('/google.datastore.v1.Datastore/RunQuery',
        $argument,
        ['\Google\Cloud\Datastore\V1\RunQueryResponse', 'decode'],
        $metadata, $options);
    }
1334634
public function evaluate(FlowQuery $flowQuery, array $arguments)
    {
        $context = $flowQuery->getContext();
        if ($context instanceof \Iterator) {
            $context = iterator_to_array($context);
        }
        if (isset($arguments[0]) && isset($arguments[1])) {
            $context = array_slice($context, (integer)$arguments[0], (integer)$arguments[1] - (integer)$arguments[0]);
        } elseif (isset($arguments[0])) {
            $context = array_slice($context, (integer)$arguments[0]);
        }

        $flowQuery->setContext($context);
    }
1210620
public function evaluate(FlowQuery $flowQuery, array $arguments) {
        if (!isset($arguments[0]) || empty($arguments[0])) {
            throw new FlowQueryException('sort() needs property name by which nodes should be sorted', 1332492263);
        } else {
            $nodes = $flowQuery->getContext();
            $sortByPropertyPath = $arguments[0];
            $sortOrder = 'DESC';
            if (isset($arguments[1]) && !empty($arguments[1]) && in_array($arguments[1], array('ASC', 'DESC'))) {
                $sortOrder = $arguments[1];
            }

            $sortedNodes = array();
            $sortSequence = array();
            $nodesByIdentifier = array();
            /** @var Node $node */
            foreach ($nodes as $node) {
                $propertyValue = $node->getProperty($sortByPropertyPath);
                if ($propertyValue instanceof \DateTime) {
                    $propertyValue = $propertyValue->getTimestamp();
                }
                $sortSequence[$node->getIdentifier()] = $propertyValue;
                $nodesByIdentifier[$node->getIdentifier()] = $node;
            }
            if ($sortOrder === 'DESC') {
                arsort($sortSequence);
            } else {
                asort($sortSequence);
            }
            foreach ($sortSequence as $nodeIdentifier => $value) {
                $sortedNodes[] = $nodesByIdentifier[$nodeIdentifier];
            }
            $flowQuery->setContext($sortedNodes);
        }
    }
108654
public function pushQuery($q, $p = array())
    {
        if (!is_array($p)) {
            throw new CommandException('Cypher query parameters should be of type array or null');
        }
        $this->statements[] = array(
            'statement' => $q,
            'parameters' => $p,
        );

        return $this;
    }
683315
public function addQuery($args): self
    {
        if (!\is_array($args) && !($args instanceof AbstractQuery)) {
            throw new InvalidException('Invalid parameter. Has to be array or instance of Elastica\Query\AbstractQuery');
        }

        return $this->addParam('queries', $args);
    }
660875
public function process(ContainerBuilder $container)
    {
        $definition = $container->findDefinition(FlowManager::class);
        foreach ($this->flowsConfig as $flowTube => $flowConfigData) {
            $flowConfig = new FlowConfig($flowTube, $flowConfigData);
            $flowDefinition = new Definition(Flow::class);
            $flowDefinition->setAutowired(true);
            $flowDefinition->setArgument('$flowConfig', $flowConfig);
            try {
                $producerDefinition = $container->findDefinition($flowConfig->getProducerServiceId());
                $producerDefinition->setShared(false);

                $producerInstanceDefinition = new Definition();
                $producerInstanceDefinition
                    ->setAutowired(true)
                    ->setClass(ProducerInstance::class)
                    ->setArgument('$flowConfig', $flowConfig)
                    ->setArgument('$producer', new Reference($flowConfig->getProducerServiceId()))
                ;
                $flowDefinition->setArgument('$producerInstance', $producerInstanceDefinition);
            } catch (ServiceNotFoundException $e) {
                throw new InvalidConfigurationException(
                    sprintf(
                        'Invalid producer for flow "%s", there is no service defined with ID "%s".',
                        $flowConfig->getDescription(),
                        $flowConfig->getProducerServiceId()
                    )
                );
            }
            try {
                $workerDefinition = $container->findDefinition($flowConfig->getWorkerServiceId());
                $workerDefinition->setShared(false);
                $workerInstancesDefinitions = [];
                for ($instanceId = 1; $instanceId <= $flowConfig->getWorkerInstancesCount(); $instanceId++) {
                    $workerInstanceDefinition = new Definition();
                    $workerInstanceDefinition
                        ->setAutowired(true)
                        ->setClass(WorkerInstance::class)
                        ->setArgument('$flowConfig', $flowConfig)
                        ->setArgument('$instanceId', $instanceId)
                        ->setArgument('$worker', new Reference($flowConfig->getWorkerServiceId()))
                    ;
                    $workerInstancesDefinitions[] = $workerInstanceDefinition;
                }
                $flowDefinition->setArgument('$workerInstances', $workerInstancesDefinitions);
            } catch (ServiceNotFoundException $e) {
                throw new InvalidConfigurationException(
                    sprintf(
                        'Invalid workder for flow "%s", there is no service defined with ID "%s".',
                        $flowConfig->getDescription(),
                        $flowConfig->getWorkerServiceId()
                    )
                );
            }
            $container->setDefinition($flowTube, $flowDefinition);
            $definition->addMethodCall('addFlow', [new Reference($flowTube)]);
        }
    }
599335
protected function queryInternal($entryId, WorkflowExpressionQuery $query)
    {
        $expression = $query->getExpression();

        if ($expression->isNested()) {
            return $this->checkNestedExpression($entryId, $expression);
        } else {
            return $this->checkExpression($entryId, $expression);
        }
    }
1058733
public function evaluate(FlowQuery $flowQuery, array $arguments)
    {
        $valuesToRemove = [];
        if (isset($arguments[0])) {
            if (is_array($arguments[0])) {
                $valuesToRemove = $arguments[0];
            } elseif ($arguments[0] instanceof \Traversable) {
                $valuesToRemove = iterator_to_array($arguments[0]);
            } else {
                $valuesToRemove[] = $arguments[0];
            }
        }
        $filteredContext = array_filter(
            $flowQuery->getContext(),
            function ($item) use ($valuesToRemove) {
                return in_array($item, $valuesToRemove, true) === false;
            }
        );
        $flowQuery->setContext($filteredContext);
    }
1307513
public function setQuery($queries)
    {
        if ($this->executed) {
            $this->clear();
        }
        $this->query->multiple()->setQuery($queries);

        return $this;
    }
1029192
protected function multiQuery(string $queries): void
  {
    if ($this->logQueries)
    {
      $time0 = microtime(true);

      $tmp = $this->mysqli->multi_query($queries);
      if ($tmp===false)
      {
        throw new DataLayerException($this->mysqli->errno, $this->mysqli->error, $queries);
      }

      $this->queryLog[] = ['query' => $queries, 'time' => microtime(true) - $time0];
    }
    else
    {
      $tmp = $this->mysqli->multi_query($queries);
      if ($tmp===false)
      {
        throw new DataLayerException($this->mysqli->errno, $this->mysqli->error, $queries);
      }
    }
  }