Perform filter column on selected field.

@param mixed $query
@param string|Closure $method
@param mixed $parameters
@param string $column
@param string $keyword
168058
protected function compileColumnQuery($query, $method, $parameters, $column, $keyword)
    {
        if (method_exists($query, $method) && count($parameters) <= with(new \ReflectionMethod($query, $method))->getNumberOfParameters()
        ) {
            if (Str::contains(Str::lower($method), 'raw') || Str::contains(Str::lower($method), 'exists')
            ) {
                call_user_func_array(
                        [$query, $method], $this->parameterize($parameters, $keyword)
                );
            } else {
                call_user_func_array(
                        [$query, $method], $this->parameterize($column, $parameters, $keyword)
                );
            }
        }
    }
116089
public function replaceQueryParameters($query, $parameters)
    {
        $i = 0;

        $result = preg_replace_callback(
            '/\?|(:[a-z0-9_]+)/i',
            function ($matches) use ($parameters, &$i) {
                $key = substr($matches[0], 1);
                if (!isset($parameters[$i]) && !isset($parameters[$key])) {
                    return $matches[0];
                }

                $value = isset($parameters[$i]) ? $parameters[$i] : $parameters[$key];
                $result = DoctrineExtension::escapeFunction($value);
                $i++;

                return $result;
            },
            $query
        );

        $result = \SqlFormatter::highlight($result);
        $result = str_replace(array("<pre ", "</pre>"), array("<span ", "</span>"), $result);

        return $result;
    }
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);
    }
706707
private function doGenericQuery($query, $city, $parameters = [])
    {
        if (is_numeric($city)) {
            $parameters['id'] = $city;
        } else {
            $parameters['q'] = $city;
        }

        $response = $this->query($query, $parameters);

        return $response;
    }
1093274
protected function buildSelectQuery(SQLSelect $query, array &$parameters)
    {
        $sql  = $this->buildSelectFragment($query, $parameters);
        $sql .= $this->buildFromFragment($query, $parameters);
        $sql .= $this->buildWhereFragment($query, $parameters);
        $sql .= $this->buildGroupByFragment($query, $parameters);
        $sql .= $this->buildHavingFragment($query, $parameters);
        $sql .= $this->buildOrderByFragment($query, $parameters);
        $sql .= $this->buildLimitFragment($query, $parameters);
        return $sql;
    }
1371646
protected function applyParameters($query)
    {
        $this->storeGlobalSettings();

        $strategies = $this->buildStrategies();

        foreach ($this->data->getApplicableAttributes() as $parameterName) {

            // should we skip it no matter what?
            if ($this->isParameterIgnored($parameterName)) continue;

            // get the value for the filter parameter
            // and if it is empty, we're not filtering by it and should skip it
            $parameterValue = $this->data->getParameterValue($parameterName);

            if ($this->isParameterValueUnset($parameterName, $parameterValue)) continue;


            // find the strategy to be used for applying the filter for this parameter
            // then normalize the strategy so that we can call_user_func on it

            $strategy = isset($strategies[$parameterName]) ? $strategies[$parameterName] : null;

            // is it a global setting, not a normal parameter? skip it
            if ($strategy === static::SETTING) continue;


            if (is_a($strategy, ParameterFilterInterface::class)) {

                $strategy = [ $strategy, 'apply' ];

            } elseif (is_null($strategy)) {
                // default, let it be handled by applyParameter

                $strategy = [ $this, 'applyParameter' ];

            } elseif ( ! is_callable($strategy) && ! is_array($strategy)) {

                throw new ParameterStrategyInvalidException(
                    "Invalid strategy defined for parameter '{$parameterName}',"
                    . " must be ParameterFilterInterface, classname, callable or null"
                );
            }

            // apply the strategy
            call_user_func_array($strategy, [ $parameterName, $parameterValue, $query, $this ]);
        }
    }
391957
private function executeQuery(string $query, array $parameters) : bool
    {
        $statement = $this->pdo->prepare($query);
        $statement->execute($parameters);

        return $statement->rowCount() !== 0;
    }
137809
public function where($table, $column, $keyword)
    {
        $connection = Connection::connect();

        $selectValue = $connection->prepare('select * from '.$table.' where '.$column.' = \''.$keyword.'\'');
        $selectValue->execute();

        return $selectValue->fetch(PDO::FETCH_ASSOC);
    }
83089
public function _search($query, $parameters = [])
    {
        /** @var \AlgoliaSearch\Laravel\ModelHelper $modelHelper */
        $modelHelper = App::make('\AlgoliaSearch\Laravel\ModelHelper');

        $index = null;

        if (isset($parameters['index'])) {
            $index = $modelHelper->getIndices($this, $parameters['index'])[0];
            unset($parameters['index']);
        } else {
            $index = $modelHelper->getIndices($this)[0];
        }

        $result = $index->search($query, $parameters);

        return $result;
    }
1318486
protected static function preprocessQuery($query, $parameters = [])
    {
        if (is_array($parameters) && count($parameters)) {
            return vsprintf($query, $parameters);
        } else {
            if (isset($parameters)) {
                return sprintf($query, $parameters);
            } else {
                return $query;
            }
        }
    }
133843
protected function query($method, $url, array $parameters = null)
    {
        return $this->httpClient->query($method, $url, $parameters);
    }
254456
public function order(string $column, string $method = "DESC") : QueryBuilder
    {
        $this->_query[] = "ORDER BY";
        $this->_query[] = "`". $this->sanitize($column) ."`";
        $this->_query[] = (strtoupper($method) === "DESC") ? "DESC" : "ASC";

        return $this;
    }
324667
public function _browseFrom($query, $parameters = [], $cursor = null)
    {
        /** @var \AlgoliaSearch\Laravel\ModelHelper $modelHelper */
        $modelHelper = App::make('\AlgoliaSearch\Laravel\ModelHelper');

        $index = null;

        if (isset($parameters['index'])) {
            $index = $modelHelper->getIndices($this, $parameters['index'])[0];
            unset($parameters['index']);
        } else {
            $index = $modelHelper->getIndices($this)[0];
        }

        $result = $index->browseFrom($query, $parameters, $cursor);

        return $result;
    }
451380
public function searchKeyword($query, KeywordSearchQuery $parameters, array $headers = [])
    {
        $data = $this->getApi()->searchKeyword($query, $this->getParameters($parameters), $headers);

        return $this->getKeywordFactory()->createResultCollection($data);
    }
642475
public function match(string $query, string $method = null)
    {
        $this->arguments = [];
        $this->methodMatched = null;
        $this->pathMatched = null;

        $matcher = new RouteMatcher();
        $res = $matcher->match(
            $this->mount,
            $this->path,
            $this->getAbsolutePath(),
            $query,
            $this->method,
            $method
        );
        $this->arguments = $matcher->arguments;
        $this->methodMatched = $matcher->methodMatched;
        $this->pathMatched = $matcher->pathMatched;

        return $res;
    }
32410
public function bindExecuteLastInsertId($query, $parameters = [])
    {
        $statement = $this->link->prepare($query);

        foreach ($parameters as $index => $paramProperties) {
            if (is_object($paramProperties)) {
                $paramProperties = (array) $paramProperties;
            }

            if (is_array($paramProperties)) {
                $statement->bindValue(
                    (int) $index + 1,
                    $paramProperties['value'],
                    $paramProperties['param']
                );
            } else {
                $statement->bindValue((int) $index + 1, $paramProperties);
            }
        }

        $statement->execute();

        return $this->link->lastInsertId();
    }
591601
private String setSelectQuery(List<String> columns) {
        if (columns != null && !columns.isEmpty()) {
            return CQLTranslator.SELECT_QUERY;
        }
        if (kunderaQuery.isAggregated()) {
            Expression selectExpression =
                ((SelectClause) kunderaQuery.getSelectStatement().getSelectClause()).getSelectExpression();
            // create query depending on function
            if (selectExpression instanceof CountFunction) {
                return CQLTranslator.SELECT_COUNT_QUERY;
            }
        }
        return CQLTranslator.SELECTALL_QUERY;
    }