{@inheritdoc}

@param FlowQuery $flowQuery the FlowQuery object
@param array $arguments the filter arguments
@return void|boolean
350254
public function evaluate(FlowQuery $flowQuery, array $arguments)
    {
        if (count($arguments) == 0) {
            return count($flowQuery->getContext()) > 0;
        } else {
            $flowQuery->pushOperation('is', []);
            $flowQuery->pushOperation('filter', $arguments);
        }
    }
1184515
public function query(array $queryArgs, array $query = [], array $options = [])
    {
        $httpParams = [
            'query_parameters' => []
        ];
        $request = [
            'volatile' => $this->volatile
        ];

        if (array_key_exists('controller', $queryArgs)) {
            $request['controller'] = $queryArgs['controller'];
        } else {
            if (!array_key_exists('route', $queryArgs) || !array_key_exists('method', $queryArgs)) {
                throw new InvalidArgumentException('Unable to execute query: missing controller or route/method');
            }

            $request['controller'] = '';
        }

        if (array_key_exists('action', $queryArgs)) {
            $request['action'] = $queryArgs['action'];
        } else {
            if (!array_key_exists('route', $queryArgs) || !array_key_exists('method', $queryArgs)) {
                throw new InvalidArgumentException('Unable to execute query: missing action or route/method');
            }

            $request['action'] = '';
        }

        if (!empty($options)) {
            if (array_key_exists('volatile', $options)) {
                foreach ($options['volatile'] as $meta => $value) {
                    $request['volatile'][$meta] = $value;
                }
            }

            if (array_key_exists('requestId', $options)) {
                $request['requestId'] = $options['requestId'];
            }

            if (array_key_exists('httpParams', $options)) {
                foreach ($options['httpParams'] as $param => $value) {
                    $httpParams[$param] = $value;
                }
            }

            if (isset($options['query_parameters'])) {
                $httpParams['query_parameters'] = array_merge($httpParams['query_parameters'], $options['query_parameters']);
            }

            foreach (['refresh', 'from', 'size', 'scroll'] as $optionParam) {
                if (array_key_exists($optionParam, $options)) {
                    $httpParams['query_parameters'][$optionParam] = $options[$optionParam];
                }
            }
        }

        if (array_key_exists('volatile', $query)) {
            foreach ($query['volatile'] as $meta => $value) {
                $request['volatile'][$meta] = $value;
            }
        }

        foreach ($query as $attr => $value) {
            if ($attr === 'body' && empty($value)) {
                $request['body'] = (object)[];
            } else if ($attr !== 'volatile') {
                $request[$attr] = $value;
            }
        }

        $request = $this->addHeaders($request, $this->headers);

        /*
        * Do not add the token for the checkToken route, to avoid getting a token error when
        * a developer simply wish to verify his token
        */
        if ($this->jwtToken && !($request['controller'] === 'auth' && $request['action'] === 'checkToken')) {
            if (array_key_exists('headers', $request) && !is_array($request['headers'])) {
                $request['headers'] = [];
            }

            $request['headers']['authorization'] = 'Bearer ' . $this->jwtToken;
        }

        foreach (['collection', 'route', 'method', 'index'] as $queryArg) {
            if (array_key_exists($queryArg, $queryArgs)) {
                $request[$queryArg] = $queryArgs[$queryArg];
            }
        }

        if (!array_key_exists('requestId', $request)) {
            $request['requestId'] = Uuid::uuid4()->toString();
        }
         // @todo move this into RequestHandler
        return $this->emitRestRequest($this->convertRestRequest($request, $httpParams));
    }
1336313
public function passesCondition(TransientVarsInterface $transientVars, array $args = [], PropertySetInterface $ps)
    {
        $status = $args['status'];
        $stepId = array_key_exists('stepId', $args) ? (int)$args['stepId'] : 0;

        /** @var WorkflowEntryInterface $entry */
        $entry = $transientVars['entry'];

        /** @var WorkflowStoreInterface $store */
        $store = $transientVars['store'];
        $currentSteps = $store->findCurrentSteps($entry->getId());

        if ($stepId === 0) {
            foreach ($currentSteps as $step) {
                if ($status === $step->getStatus()) {
                    return true;
                }
            }
        } else {
            foreach ($currentSteps as $step) {
                if (($stepId === $step->getStepId())
                    && ($status === $step->getStatus())) {
                    return true;
                }
            }
        }

        return false;
    }
131437
public function runWorkflow(int $workflowId, array $convos): void
    {
        Assert::notEmpty(
            $convos,
            'Conversations cannot be empty'
        );

        $conversations = new RunWorkflowRequest($convos);

        $uri = sprintf(self::RUN_WORKFLOW_URL, $workflowId);

        foreach ($conversations->getBatch() as $batch) {
            $this->restClient->createResource($batch, $uri);
        }
    }
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);
    }
337011
public function evaluate(FlowQuery $flowQuery, array $arguments)
    {
        $term = isset($arguments[0]) ? $arguments[0] : null;
        $filterNodeTypeName = isset($arguments[1]) ? $arguments[1] : null;

        $nodeTypes = strlen($filterNodeTypeName) > 0 ? [$filterNodeTypeName] : array_keys($this->nodeTypeManager->getSubNodeTypes('Neos.Neos:Document', false));

        /** @var NodeInterface $contextNode */
        $contextNode = $flowQuery->getContext()[0];

        $context = $contextNode->getContext();

        if ($term) {
            $matchedNodes = $this->nodeSearchService->findByProperties($term, $nodeTypes, $context, $contextNode);
        } else {
            $matchedNodes = [];
            // Yep, an internal API. But that's what we used in the old UI.
            $nodeDataRecords = $this->nodeDataRepository->findByParentAndNodeTypeRecursively($contextNode->getPath(), implode(',', $nodeTypes), $context->getWorkspace(), $context->getDimensions());
            foreach ($nodeDataRecords as $nodeData) {
                $matchedNode = $this->nodeFactory->createFromNodeData($nodeData, $context);
                if ($matchedNode !== null) {
                    $matchedNodes[$matchedNode->getPath()] = $matchedNode;
                }
            }
        }

        $flowQuery->setContext($matchedNodes);
    }
83057
public function setQueryFromArguments($newArguments)
    {
        $this->setQueryString(trim($newArguments['queryString']));
        $this->querySwitchFulltext = ($newArguments['querySwitchFulltext'] != '');
        $this->queryStringTitle = trim($newArguments['queryStringTitle']);
        $this->querySwitchJournalOnly = ($newArguments['querySwitchJournalOnly'] != '');
        $this->queryStringPerson = trim($newArguments['queryStringPerson']);
        $this->queryStringKeyword = trim($newArguments['queryStringKeyword']);
        $this->queryStringDate = trim($newArguments['queryStringDate']);
    }
234712
@SafeVarargs
  public final QueryBuilder arguments(Object...args) {
    set(Param.QUERY_ARGS, "");
    queryArgs = args.clone();
    return this;
  }
1002426
public void updateFlowConfig(FlowConfig flowConfig)
      throws RemoteInvocationException {
    LOG.debug("updateFlowConfig with groupName " + flowConfig.getId().getFlowGroup() + " flowName " +
        flowConfig.getId().getFlowName());

    FlowId flowId = new FlowId().setFlowGroup(flowConfig.getId().getFlowGroup())
        .setFlowName(flowConfig.getId().getFlowName());

    UpdateRequest<FlowConfig> updateRequest =
        _flowconfigsRequestBuilders.update().id(new ComplexResourceKey<>(flowId, new EmptyRecord()))
            .input(flowConfig).build();

    ResponseFuture<EmptyRecord> response = _restClient.get().sendRequest(updateRequest);

    response.getResponse();
  }
1185054
public function pushQuery($query, array $parameters = array())
    {
        $this->checkIfOpened();
        try {
            $response = $this->handleResponse($this->client->pushToTransaction($this->transactionId, $query, $parameters, $this->conn));
            $result = $response->getResult();
            $this->results[] = $result;

            return $result;
        } catch(HttpException $e) {
            $this->rollback();
            throw $e;
        }

    }
660929
public function run($data, string $node, string $port): NetworkInterface
    {
        if (empty($this->graph)) {
            throw new FlowException(
                "Graph is not yet initialized!"
            );
        }

        $this->graph->addInitial($data, $node, $port);

        return $this;
    }
432323
function runQuery(client, queryString, args, callback) {
  if (activeBackend === 'mysql') {
    queryString = queryString.replace(/\$\d+/, '?');
  }

  client.query(queryString, args, function (err, result) {
    if (err) {
      callback(err, null);
      return;
    }
    if (activeBackend === 'mysql') {
      callback(err, result);
    }
    else if (activeBackend === 'pgsql') {
      var rows = [];
      if (result.rows) {
        rows = result.rows;
      }
      callback(err, rows);
    }
  });
}
749961
private function applyConditions(QueryBuilder $query, array $conditions): void
    {
        foreach ($conditions as $identifier => $value) {
            $query->andWhere(
                $query->expr()->eq($identifier, ':' . $identifier)
            );

            $query->setParameter($identifier, $value, is_int($value) ? Type::INTEGER : Type::STRING);
        }
    }
450703
protected function isValid($value)
    {
        if (is_null($value)) {
            return;
        } elseif ($value) {
            $context = [$value];
        } else {
            $context = [];
        }

        $q = new FlowQuery($context);

        if ($q->is('[instanceof ' . $this->options['type'] . ']')) {
            return;
        }

        $this->addError('The value is expected to satisfy the %s flowQuery condition.', 1515144113, [
            $this->options['type']
        ]);
    }
769738
protected function _setQuery(string $type, $args): self
    {
        if (!\is_array($args) && !($args instanceof AbstractSpanQuery)) {
            throw new InvalidException('Invalid parameter. Has to be array or instance of Elastica\Query\AbstractSpanQuery');
        }

        return $this->setParam($type, $args);
    }
56784
private function hasTooManyArguments(array $argumentValues, array $commandArguments) : bool
    {
        if (count($argumentValues) > count($commandArguments)) {
            // Only when the last argument is an array do we allow more request arguments than command arguments
            if (count($commandArguments) === 0 || !end($commandArguments)->isArray()) {
                return true;
            }
        }

        return false;
    }
972324
public function setFilters($filters, QueryBuilder &$query, QueryBuilder &$countQuery, &$selects)
    {
        //then we set the filters
        if ($filters && is_array($filters)) {
            foreach ($filters as $filter) {
                //get the field object
                $fieldObject = $this->fieldFactory->findFilter($filter['field_name']);

                //set the filter on the object
                $fieldObject->setFilter($filter);

                //filter the query objects, only pass in the selects the first time so they aren't added twice
                $fieldObject->filterQuery($query, $selects);
                $fieldObject->filterQuery($countQuery);
            }
        }
    }