medoo::query()

@param  string $query
@param  array  $map
@return \PDOStatement
8417
public function query($query, $map = [])
    {
        $statement = parent::exec($query, $map);
        $lastSQL = parent::last();
        Container::get('logger')->info($lastSQL);
        array_push(self::$queries, $lastSQL);
        return $statement;
    }
39958
public function query(
        Query $query,
        array $parameters = []
    ): Result {
        $result = $this
            ->repository
            ->query($query, $parameters);

        return $this->applyTransformersToResult($result);
    }
1037099
public function query($query) {
		$args = func_get_args();
		$query = array_shift($args);
		return $this->execute($query, $args);
	}
771823
public function query($q, $params = array()){
		try{
			if(!empty($this->pdo)){
				$this->st = $this->pdo->prepare($q);
				if(!empty($params)){
					$keys = array_keys($params);
					$qmark = false;//qmark = question mark
					if(is_int($keys[0])){//mode '?'
						$qmark = true;
					}

					foreach($params as $p => $val){
						if($qmark){
							//$p is a numeric - 0, 1, 2, ...
							$p += 1;//bindValue starts to 1
						}
						if(is_array($val) && count($val) == 2){//if called with PDO::PARAM_STR or PDO::PARAM_INT, PDO::PARAM_BOOL
							$this->st->bindValue($p, $val[0], $val[1]);
						}
						else{
							if(! is_bool($val)) { //fix fatal error with some php versions
								$this->st->bindValue($p, $val);
							}
							else {
								$this->st->bindValue($p, $val, PDO::PARAM_INT);//cast
							}
						}
					}
				}

				$this->st->execute();
				return $this->st;
			}
			else{
				throw new DBException('PDO attribute is undefined');
			}
		}
		catch(\Exception $e){
			throw new DBException($e->getMessage(), $e->getCode());
		}
	}
659234
public function fetchCol($query, array $parameters = array())
    {
        $parameters = $this->parameterTransformer->transform($parameters);
        return $this->db->fetchCol($query, $parameters);
    }
122979
public function setQuery(string $query, $bindings = null): Query
    {
        $this->query = $query;

	    if ($bindings === null) {
		    $this->bindings = new Bindings();

	    } else if (is_array($bindings)) {
		    $this->bindings = new Bindings();
		    $this->bindings->setFromArray($bindings);

	    } else if ($bindings instanceof Bindings) {
		    $this->bindings = $bindings;

	    } else {
		    throw new \InvalidArgumentException('Invalid second argument provided, expected null, array or instance of Bindings');
	    }

        return $this;
    }
804876
protected function mappedSelectListsKey(Builder $query, $key)
    {
        if ($this->hasColumn($key)) {
            return $query->addSelect($this->getTable() . '.' . $key);
        }

        return $query->addSelect($key);
    }
355055
public function query ($query, $data = array(), $entity = null)
		{
			if ($this->cache->isCached($query)) {
				return $this->cache->getCachedResult($query);
			} else {
				try {
					$statement = $this->database->prepare((string) $query, array(PDO::ATTR_CURSOR => PDO::CURSOR_SCROLL));
					$result = $statement->execute($data);
					$this->lastQuery = $statement->queryString;
					$this->lastStatement = $statement;

					if (! $result) {
						throw new DatabaseException(implode(': ', $statement->errorInfo()) . PHP_EOL . PHP_EOL . $query);
					}

				} catch (PDOException $e) {
					throw new DatabaseException($e->getMessage() . PHP_EOL . PHP_EOL . $query);
				}

				$databaseResult = $this->createResult($statement, $entity);

				if ($query instanceof DatabaseQuery && $databaseResult instanceof DatabaseResult) {
					$this->cache->cacheQuery($query, $databaseResult);
				}

				if ($query instanceof DatabaseQuery) {
					$this->cache->refreshCache($query);
				}

				if ($databaseResult instanceof DatabaseResult) {
					return $databaseResult;

				} else if ($query instanceof DatabaseQuery && $query->getType() == DatabaseQuery::QUERY_TYPE_INSERT) {
					return $this->insertId($query->getTable());

				} else {
					return $databaseResult;
				}
			}
		}
730556
public function prepare($query)
    {
        $this->connect();
        $isObject = $query instanceof Query;
        $statement = $this->_connection->prepare($isObject ? $query->sql() : $query);

        return new PDOStatement($statement, $this);
    }
726975
public function update($table, array $map = []): Query\UpdateQuery
    {
        $query = $this->engine->makeUpdate()->table($table);
        if (empty($map) === false) {
            $query = $query->set($map);
        }
        return $query;
    }
313252
public function query($query)
    {
        if (is_subclass_of($query, 'Database\Query\QueryAbstract')) {
            return $this->query($this->buildQuery($query));
        }

        $debug = (new Debug\ExecutedQuery($query))->setBacktrace(debug_backtrace());
        $startTime = microtime(true);
        try {
            $result = $this->pdo->query($query);
        } catch (\Throwable $throwable) {
            $debug->setException($throwable);
            throw $throwable;
        } finally {
            $debug->setExecutionTime(microtime(true) - $startTime);
            Debug::addQuery($debug);
        }

        return $this->getPDODatabaseRecord($result);
    }
381487
protected function executeQuery($query)
    {
        $query   = null !== $this->getLocale() ? sprintf('%s&language=%s', $query, $this->getLocale()) : $query;
        $content = $this->getAdapter()->get($query)->getBody();

        if (!$data = json_decode($content, true)) {
            throw new NoResult(sprintf('Could not execute query: %s', $query));
        }

        if (!isset($data['Response']) && 'InvalidCredentials' === $data['subtype']) {
            throw new InvalidCredentials(sprintf('Invalid credentials: %s', $data['details']));
        } elseif (!isset($data['Response'])) {
            throw new NoResult(
                sprintf('Error type `%s` returned from api `%s`', $data['subtype'], $data['Details'])
            );
        }

        if (empty($data['Response']['View'])) {
            throw new NoResult(sprintf('Could not find results for given query: %s', $query));
        }

        $locations = $data['Response']['View'][0]['Result'];

        $results = array();
        foreach ($locations as $location) {
            $location       = $location['Location'];
            $coordinates    = isset($location['NavigationPosition'][0]) ? $location['NavigationPosition'][0] : $location['DisplayPosition'];
            $bounds         = $location['MapView'];
            $address        = $location['Address'];
            $additionalData = $location['Address']['AdditionalData'];

            $results[] = array_merge($this->getDefaults(), array(
                'latitude'     => $coordinates['Latitude']  ?: null,
                'longitude'    => $coordinates['Longitude'] ?: null,
                'bounds'       => array(
                    'south' => $bounds['BottomRight']['Latitude']  ?: null,
                    'west'  => $bounds['TopLeft']['Longitude']     ?: null,
                    'north' => $bounds['TopLeft']['Latitude']      ?: null,
                    'east'  => $bounds['BottomRight']['Longitude'] ?: null,
                ),
                'streetNumber' => isset($address['HouseNumber']) ? $address['HouseNumber'] : null,
                'streetName'   => isset($address['Street'])      ? $address['Street']      : null,
                'city'         => isset($address['City'])        ? $address['City']        : null,
                'cityDistrict' => isset($address['District'])    ? $address['District']    : null,
                'zipcode'      => isset($address['PostalCode'])  ? $address['PostalCode']  : null,
                'county'       => isset($address['County'])      ? $address['County']      : null,
                'regionCode'   => isset($address['State'])       ? $address['State']       : null,
                'countryCode'  => isset($address['Country'])     ? $address['Country']     : null,
                'region'       => $this->findByKey('StateName', $additionalData),
                'country'      => $this->findByKey('CountryName', $additionalData),
                'countyCode'   => null,
            ));
        }

        return $results;
    }
666871
public static function query($query = [])
    {
        if (func_num_args()) {
            static::$_query[static::class] = is_array($query) ? $query : [];
        }
        return isset(static::$_query[static::class]) ? static::$_query[static::class] : [];
    }
549412
public function distinct($key, $query = [])
    {
        if ($query instanceof Closure) {
            // Store the callback
            $callback = $query;

            // Create a new Where filter.
            $query = new Query\Where();

            // trigger callback
            $callback($query);
        }

        if ($query instanceof Query\Where) {
            // Get the filter.
            $query = $query->getWhere();
        }

        return $this->collection->distinct($key, $query);
    }
716933
protected function prepare($query, $param)
    {
        /**
         * @var \PdoStatement $stmt
         */
        $stmt = $this->db->prepare($query);

        foreach ($param as $set) {
            if (isset($set['value']) || isset($set['name'])) {
                $value = &$set['value'];
                $key   = $set['name'];
            } else {
                $value = &$set[1];
                $key   = $set[0];
            }

            if (!$key) {
                continue;
            }
            $stmt->bindParam($key, $value);
        }

        return $stmt;
    }
271226
public function setQuery($query)
    {
        if (!empty($query)) {
            $this->data['query'] = $this->_queryToArray($query);
        }

        return $this;
    }
105210
public function query(string $query, array $bindings = null): Query
    {
        $this->lastQuery = new Query($query, $bindings, $this->configKey);
        return $this->lastQuery;
    }