Returns a list of game objects matching the search query.

Learn more:
https://github.com/justintv/Twitch-API/blob/master/v3_resources/search.md#get-searchgames

@param  string $query   Search query
@param  array $params  Optional params

@return array
1731
public function searchGames($query, $params = [])
  {
      $defaults = [
          'query' => urlencode($query),
          'limit' => 25,
          'type'  => 'suggest',
          'live'  => false,
      ];

      return $this->wrapper->request('GET', 'search/games', ['query' => $this->resolveOptions($params, $defaults)]);
  }
590965
public function executeFetchOne(
        $query = null,
        $params = []
    ) {

        $this->execute($query, $params);
        return $this->fetchOne();
    }
1312270
public function query($query, $params = array())
  {
    $curl = new Curl();
    $params['key'] = $this->server_key;
    $result = json_decode($curl->call(self::GOOGLEPLUS_API_URL . trim($query, '/') . '?' . http_build_query($params), array(), 'GET', true), true);
    if(!isset($result['error'])) {
      return $result;
    }
    return $this->debug_mode ? $result['error']['message'] : null;
  }
349281
public function select($query, array $params = [], $fetchMode = null)
    {
        // Execute query
        $stmt = $this->connection->prepare($query);
        $stmt->execute($params);
        if ($fetchMode !== null) {
            $stmt->setFetchMode($fetchMode);
        }
        return $stmt->fetchAll();
    }
1214782
public function search(string $query, array $arguments = null)
    {
        $args = ['q' => $query];
        if (is_array($arguments)) {
            $args = array_merge($arguments, $args);
        }
        return new SearchIterator($this, 'search/tweets', $args);
    }
976018
public function queryAndReturnResult($query, $params = [])
    {
        $schema = $this->schema();
        $context = $this->getContext();

        $last = function ($schema, $query, $context, $params) {
            return GraphQL::executeQuery($schema, $query, null, $context, $params);
        };

        return $this->callMiddleware($schema, $query, $context, $params, $last);
    }
583773
public function search($query)
    {
        $this->logger->debug('Meda:search');
        if (!Tools::isGoodString($query)) {
            $this->logger->error('Media::search: invalid query');
            return [];
        }
        $this->setGeneratorSearch($query, self::MEDIA_NAMESPACE);
        return $this->getImageinfoResponse();
    }
949545
private function parse(&$params, &$query) {

		//Check the type of param binding ("?" = all keys are numeric or ":" = all keys are strings)
	 	if(0 !== count(array_filter(array_keys($params), 'is_string'))) {
			
			preg_match_all('#:((?:[a-zA-Z_])(?:[a-zA-Z0-9-_]+)?)#', $query, $variables);

			if(true === isset($variables[0])) {

				$parameters = [];

				foreach($variables[0] as $index => $variable) {
					
					if(false === array_key_exists($variables[1][$index], $params)) {
						return trigger_error(sprintf('Parameter "%s" missing from bind parameters', $variables[1][$index]), E_USER_ERROR);
					}
					
					$parameters[] =& $params[$variables[1][$index]];
					$query = str_replace($variables[0][$index], '?', $query);
				}

				$params = $parameters;
			}
	 	}

		$bind = [];

		if(count($params) > 0) {

			$types = '';

			foreach($params as $param => $value) {

				switch(gettype($value)) {
		            
		            case 'NULL'		:
		            case 'string'	: $types .= 's'; break;

		            case 'boolean'	:
		            case 'integer'	: $types .= 'i'; break;
		            
		            case 'blob'		: $types .= 'b'; break;
		            
		            case 'double'	: $types .= 'd'; break;
		        }
			}

			$bind[] =& $types;

			foreach($params as $param => $value) {
				$bind[] =& $params[$param];
			}
		}

		return $bind;
	}
175612
public function query($query, array $params = null)
    {
        # If the next query should be cached then run the cache function instead
        if ($this->cacheNext) {
            $this->cacheNext = false;
            return $this->cache($query, $params);
        }

        # Ensure we have a connection to run this query on
        $this->connect();

        $this->query = $query;
        $this->params = null;
        $this->preparedQuery = false;

        if (is_array($params)) {
            $this->params = $params;
        }

        $this->quoteChars($query);
        $this->functions($query);
        $this->limit($query);
        $this->tableNames($query);
        $this->namedParams($query, $params);
        $this->paramArrays($query, $params);
        $this->convertNulls($params);

        $preparedQuery = $this->prepareQuery($query, $params);
        $this->preparedQuery = $preparedQuery;

        if ($this->output) {
            if ($this->htmlMode) {
                echo "<pre>";
            }

            echo $preparedQuery;

            if ($this->htmlMode) {
                echo "<hr>";
            } else {
                echo "\n";
            }
        }

        switch ($this->mode) {

            case "mysql":
                if (!$result = $this->server->query($preparedQuery)) {
                    $this->error();
                }
                break;

            case "postgres":
            case "redshift":
                $tmpQuery = $query;
                $query = "";

                $noParams = false;
                if ($this->mode == "redshift" && count($params) > 32767) {
                    $noParams = true;
                }

                $i = 1;
                reset($params);
                while ($pos = strpos($tmpQuery, "?")) {
                    if ($noParams) {
                        $query .= substr($tmpQuery, 0, $pos) . "'" . pg_escape_string(current($params)) . "'";
                        next($params);
                    } else {
                        $query .= substr($tmpQuery, 0, $pos) . "\$" . $i++;
                    }
                    $tmpQuery = substr($tmpQuery, $pos + 1);
                }
                $query .= $tmpQuery;

                $params = Helper::toArray($params);
                if (!$result = pg_query_params($this->server, $query, $params)) {
                    $this->error();
                }
                break;

            case "odbc":
                if (!$result = odbc_prepare($this->server, $query)) {
                    $this->error();
                }
                $params = Helper::toArray($params);
                if (!odbc_execute($result, $params)) {
                    $this->error();
                }
                break;

            case "sqlite":

                if (!is_array($params)) {
                    if (!$result = $this->server->query($preparedQuery)) {
                        $this->error();
                    }

                # If we have some parameters then we must convert them to the sqlite format
                } else {
                    $newQuery = "";
                    foreach ($params as $key => $val) {
                        $pos = strpos($query, "?");
                        $newQuery .= substr($query, 0, $pos);
                        $query = substr($query, $pos + 1);

                        $newQuery .= ":var" . $key;
                    }
                    $newQuery .= $query;

                    if (!$result = $this->server->prepare($newQuery)) {
                        $this->error();
                    }

                    foreach ($params as $key => $val) {
                        switch (gettype($val)) {

                            case "boolean":
                            case "integer":
                                $type = SQLITE3_INTEGER;
                                break;

                            case "double":
                                $type = SQLITE3_FLOAT;
                                break;

                            case "NULL":
                                if ($this->allowNulls) {
                                    $type = SQLITE3_NULL;
                                } else {
                                    $type = SQLITE3_TEXT;
                                    $val = "";
                                }
                                break;

                            default:
                                $type = SQLITE3_TEXT;
                        }

                        $result->bindValue(":var" . $key, $val, $type);
                    }

                    if (!$result = $result->execute()) {
                        $this->error();
                    }
                }
                break;

            case "mssql":
                if (!$result = mssql_query($preparedQuery, $this->server)) {
                    $this->error();
                }
                break;

            case "mssqlsrv":
                if (!$result = sqlsrv_query($this->server, $preparedQuery)) {
                    $this->error();
                }
        }

        if (!$result) {
            $this->error();
        }

        return new Result($result, $this->mode);
    }
798803
public function sqlSearch($params)
    {
        $this->load($params);

        $where =[
           'id' => sprintf('id = "%s"',$this->id),
           'status' => sprintf('status = "%s"',$this->status),
           'created_at' => sprintf('created_at = "%s"',$this->created_at),
           'updated_at' => sprintf('updated_at = "%s"',$this->updated_at),
           'username' => sprintf('username like "%s%%"',$this->username),
           'auth_key' => sprintf('auth_key like "%s%%"',$this->auth_key),
           'password_hash' => sprintf('password_hash like "%s%%"',$this->password_hash),
           'password_reset_token' => sprintf('password_reset_token like "%s%%"',$this->password_reset_token),
           'email' => sprintf('email like "%s%%"',$this->email),
        ];

        $filtedParams = array_filter($this->attributes,
            function($val){return $val!='';});

        $FiltedWhere = ['1=1'];
        foreach ($filtedParams as $key => $value) {
            $FiltedWhere[] = $where[$key];
        }

        $querySql = sprintf('
            SELECT
                %s
            FROM
                %s
            WHERE
                %s
            ', '*', $this->tableName(), implode(' AND ', $FiltedWhere));

        $countSql = sprintf('
            SELECT
                %s
            FROM
                %s
            WHERE
                %s
            ', 'count(1)', $this->tableName(), implode(' AND ', $FiltedWhere));

        $sqlDataProvider = new SqlDataProvider([
            'sql' => $querySql,
            // 'params' => [':sex' => 1],
            'totalCount' => Yii::$app->db->createCommand($countSql)->queryScalar(),
            //'sort' =>false,//如果为假则删除排序
            'key' => 'id',
            'sort' => [
                'defaultOrder' => [
                    'id' => SORT_DESC
                ],
                'attributes' => array_keys($this->attributes),
            ],
            'pagination' => [
                'pageSize' => 10,
            ],
        ]);

        return $sqlDataProvider;
    }
520620
public static function search($query) {
    global $server;
    $response = $server->doCall('search', ['query' => $query]);
    $result = [];
    foreach ($response->getValue('list') as $item) {
      $result[] = ['type' => $item['type'], 'oid' => $item['oid'],
        'displayValue' => $item['displayValue'], 'summary' => $item['summary']
      ];
    }
    return ['return' => $result];
  }
918255
public function queryList($query, $options = array())
    {
        $statement = $this->_runQuery($query, $options);
        return $statement->fetch(\PDO::FETCH_NUM);
    }
548505
public function query($query, $params = array())
  {
    $curl = new Curl();
    $params['client_id'] = $this->client_id;
    $params['access_token'] = $this->access_token;
    $result = json_decode($curl->call(self::INSTAGRAM_API_URL . trim($query, '/') . '?' . http_build_query($params), array(), 'GET', true), true);
    if($result['meta']['code'] == 200) {
      return $result['data'];
    }
    return $this->debug_mode ? $result : null;
  }
414835
public function getList(array $query = [])
    {
        $resource = self::$BASE_URI . '/' . $this->cityId . '/bairros/' . $this->neighborhoodId . '/logradouro';
        $list = $this->pagination($resource);

        return $list;
    }
1188224
public function query($query, array $params = [])
    {
        $this->query  = $query;
        $this->params = $params;
        $this->send();

        return $this;
    }
503216
function query (query, params) {
        let rows = [];
        let stmt = sql.prepare(query);
        params = normalizeParams(params);
        stmt.bind(params);
        while(stmt.step()) {
            rows.push(stmt.getAsObject());
        }
        stmt.free();
        return rows;
    }
1274378
public function query($query, $params = array())
  {
    $results = $this->api->get($query, $params);
    if(!isset($results->errors)) {
      return $results;
    } else {
      return $this->debug_mode ? $results->errors[0]->message : null;
    }
  }