@param DataStructure\Query\Query $queries

@return mixed
161385
public function query(DataStructure\Query\Query $queries)
    {
        $logicFunc = 'andWhere';
        if ($queries instanceof DataStructure\OrQuery) {
            $logicFunc = 'orWhere';
        }

        foreach ($queries as $query) {

            if ($this->isExcludedProperty($query->getProperty())) {
                continue;
            }

            $value = $this->unlockSpecialProperty($query->getProperty(), $query->getValue());

            if ($query instanceof Expression\Equal) {

                $this->criteria->{$logicFunc}(Criteria::expr()->eq($query->getProperty(), $value));

            } elseif ($query instanceof Expression\NotEqual) {

                $this->criteria->{$logicFunc}(Criteria::expr()->neq($query->getProperty(), $value));

            } elseif ($query instanceof Expression\GreaterThan) {

                $this->criteria->{$logicFunc}(Criteria::expr()->gt($query->getProperty(), $value));

            } elseif ($query instanceof Expression\GreaterThanEqual) {

                $this->criteria->{$logicFunc}(Criteria::expr()->gte($query->getProperty(), $value));

            } elseif ($query instanceof Expression\LesserThan) {

                $this->criteria->{$logicFunc}(Criteria::expr()->lt($query->getProperty(), $value));

            } elseif ($query instanceof Expression\LesserThanEqual) {

                $this->criteria->{$logicFunc}(Criteria::expr()->lte($query->getProperty(), $value));

            } elseif ($query instanceof Expression\In) {

                $this->criteria->{$logicFunc}(Criteria::expr()->in($query->getProperty(), $value));

            } elseif ($query instanceof Expression\NotIn) {

                $this->criteria->{$logicFunc}(Criteria::expr()->notIn($query->getProperty(), $query->getValue()));

            }

        }
    }
517058
public function runSparql(string $query, int $nTries = null): Result {
        return $this->sparqlClient->query($query, $nTries ?? $this->sparqlNTries);
    }
541261
public function query( $query, array $bindings = [] ) {
		return $this->run( $query, $bindings, function ( $query, $bindings ) {
			if ( $this->pretending() ) {
				return true;
			}

			// @codingStandardsIgnoreLine
			return $this->wpdb->query( $this->prepareQuery( $query, $bindings ) );
		} );
	}
1359638
private function getUserPasswordMigrations($queries)
    {
        $db        = Db::get();
        $userTable = Common::prefixTable($this->userTable);

        $users = $db->fetchAll(
            'SELECT `login`, `password` FROM `' . $userTable . '` WHERE LENGTH(`password`) = 32'
        );

        foreach ($users as $user) {
            $queries[] = $this->migration->db->boundSql(
                'UPDATE `' . $userTable . '`'
                . ' SET `password` = ?'
                . ' WHERE `login` = ?',
                [
                    password_hash($user['password'], PASSWORD_BCRYPT),
                    $user['login'],
                ]
            );
        }

        return $queries;
    }
1336652
public function fromQuery($query, $bindings = [])
    {
        return $this->hydrate(
            $this->query->getConnection()->select($query, $bindings)
        );
    }
637749
protected function prepareQuery( $query, array $bindings ) {
		if ( false !== strpos( $query, '%' ) && count( $bindings ) > 0 ) {
			// @codingStandardsIgnoreLine
			$query = $this->wpdb->prepare( $query, $this->prepareBindings( $bindings ) );
		}

		return $query;
	}
1226335
public function newQueryForRestoration($ids)
    {
        return is_array($ids)
                ? $this->newQueryWithoutScopes()->whereIn($this->getQualifiedKeyName(), $ids)
                : $this->newQueryWithoutScopes()->whereKey($ids);
    }
1129825
public function transaction(Closure $queries)
	{
		try
		{
			$this->beginTransaction();

			$returnValue = $queries($this);

			$this->commitTransaction();
		}
		catch(PDOException $e)
		{
			$this->rollBackTransaction();

			throw $e;
		}

		return $returnValue;
	}
689291
public function getAnswer(array $queries): array
    {
        $answers = [];
        foreach ($queries as $query) {
            $answer = $this->resourceRecords[$query->getName()][$query->getType()][$query->getClass()] ?? [];
            if (empty($answer)) {
                $answer = $this->findWildcardEntry($query);
            }

            $answers = array_merge($answers, $answer);
        }

        return $answers;
    }
1307513
public function setQuery($queries)
    {
        if ($this->executed) {
            $this->clear();
        }
        $this->query->multiple()->setQuery($queries);

        return $this;
    }
761992
public function getQuery($queryParams)
    {
        return array_key_exists($queryParams, $this->query) ? $this->query[$queryParams] : null;
    }
403499
public function store($query, Traversable $results)
    {
        $key = $this->_resolveKey($query);
        $storage = $this->_resolveCacher();

        return $storage->write($key, $results);
    }
1100316
protected function getSqlQuery($query, $bindings, $execTime)
    {
        $bindings = $query->bindings;
        $execTime = $query->time;
        $query = $query->sql;
    
        // need to format bindings properly
        foreach ($bindings as $i => $binding) {
            if ($binding instanceof \DateTime) {
                $bindings[$i] = $binding->format('Y-m-d H:i:s');
            } elseif (is_string($binding)) {
                $bindings[$i] = str_replace("'", "\\'", $binding);
            }
        }

        // now we create full SQL query - in case of failure, we log this
        $query = str_replace(['%', '?', "\n"], ['%%', "'%s'", ' '], $query);
        $fullSql = vsprintf($query, $bindings);

        return [$fullSql, $execTime];
    }
1138914
public function selectOne($query, $bindings = [])
    {
        $start = $this->getLogTime();

        try {

            $result = $this->wpdb->get_row($this->bindParams($query, $bindings));

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

            return $result;

        } catch (QueryException $e) {
            throw $e;
        } finally {
            $this->logQuery($query, $bindings, $this->getElapsedTime($start));
        }
    }
766146
protected function statement($query, $bindings = array())
    {
        $statement  = $this->getActivePdo()->prepare($query);

        return $statement->execute($bindings);
    }
264849
public function track(array $queries)
    {
        if (count($queries) == 0)
            return null;

        $data = [
            'query'     => $this->prepareQuery($queries),
            'arguments' => $this->prepareArguments($queries),
        ];

        return $this->getModel()
            ->newQuery()
            ->firstOrCreate(Arr::only($data, ['query']), $data)
            ->getKey();
    }
97065
public function statement( $query, $bindings = [] )
	{
		$new_query = $this->bind_params( $query, $bindings, true );

		return $this->unprepared( $new_query );
	}