Dekoruje querę na podstawie filtrów
@param \Mmi\Orm\Query $query
@return \Mmi\Orm\Query
@throws GridException
432746
public function setupQuery(\Mmi\Orm\Query $query)
    {
        //stosowanie filtrów i sortowań
        $this->_applyFilters($query)
            ->_applyOrder($query);
        //ustawia rozmiar danych
        $this->_dataCount = $query->count();
        //obliczenia offsetu
        $offset = ($this->getPage() - 1) * $this->getRowsPerPage();
        //jeśli offset jest nieprawidłowy
        if ($offset > $this->_dataCount) {
            throw new GridException('Invalid offset');
        }
        //limitowanie
        $query->limit($this->getRowsPerPage())
            ->offset($offset);
        return $query;
    }
898304
public function selectOne( $query, $bindings = [] )
	{
		$query = $this->bind_params( $query, $bindings );

		$result = $this->db->get_row( $query );

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

		return $result;
	}
1023759
public function exec($query)
    {
        try {
            $this->connection->exec($query);
        } catch (DBALException $e) {
            throw new QueryException($e->getMessage(), $e->getCode(), $e);
        }
    }
259596
protected function _performQuery($query)
    {
        //brak query
        if (!trim($query)) {
            return;
        }
        //start transakcji
        \App\Registry::$db->beginTransaction();
        //quera jeśli błędna rollback i die, jeśli poprawna commit
        try {
            //wykonanie zapytania
            \App\Registry::$db->query($query);
            //commit
            \App\Registry::$db->commit();
        } catch (\Mmi\Db\DbException $e) {
            //rollback
            \App\Registry::$db->rollBack();
            throw $e;
        }
    }
148481
public function modifyQuery(Query $query)
    {
        return $this->queryBuilder->startFrom($query)->useDebug(true)->getQuery();
    }
477462
public function setQuery(\Parable\ORM\Query $query)
    {
        $this->query = $query;

        $this->setTableName($query->getTableName());
        return $this;
    }
164406
public static function mergeQuery($uri, $query)
    {
        return $uri->withQuery((string) (new Query(self::filterUri($uri)->getQuery()))->merge($query));
    }
538607
public function prepareExecuteAndFetchAll(Query $query)
    {
        $prepare = $this->prepareQuery($query);
        $execute = $this->executePrepared($prepare);

        return $this->fetchAllPrepared($prepare);
    }
514626
public function setQuery(Query $query)
    {
        $this->query = $query;
        $this->clonedQuery = clone $query;

        return $this;
    }
39958
public function query(
        Query $query,
        array $parameters = []
    ): Result {
        $result = $this
            ->repository
            ->query($query, $parameters);

        return $this->applyTransformersToResult($result);
    }
888310
public function scopeFilter($query)
    {
        if (!$this->filters) {

            $message = 'Please set the $filters property.';
            throw new FilterableSortableException($message);
        }

        $this->filters = app()->make($this->filters);

        if (!$this->filters instanceof QueryFilters) {

            $message = '$filters property must be a class instance of QueryFilter.';
            throw new FilterableSortableException($message);
        }

        return $this->filters->apply($query);
    }
909463
protected final function _mergeQueries(Query $query, $and = true)
    {
        $compilation = $query->getQueryCompile();
        //łączenie where
        if ($compilation->where) {
            $connector = $this->_compile->where ? ($and ? ' AND (' : ' OR (') : 'WHERE (';
            $this->_compile->where .= $connector . substr($compilation->where, 6) . ')';
        }
        //łączenie wartości
        if (!empty($compilation->bind)) {
            $this->_compile->bind = array_merge($compilation->bind, $this->_compile->bind);
        }
        //suma joinów query nadrzędnej i podrzędnej
        if (!empty($compilation->joinSchema)) {
            $this->_compile->joinSchema = array_merge($this->_compile->joinSchema, $compilation->joinSchema);
        }
        //łączenie order
        if ($compilation->order) {
            if (substr($this->_compile->order, 0, 8) == 'ORDER BY' && substr($compilation->order, 0, 8) == 'ORDER BY') {
                $this->_compile->order .= ', ' . substr($compilation->order, 9);
            } else {
                $this->_compile->order .= $compilation->order;
            }
        }
        return $this;
    }
1374911
public function setQuery($query)
    {
        if (!($query instanceof QueryString)) {
            $this->query = new QueryString($query);

            return $this;
        }

        $this->query = $query;

        return $this;
    }
990718
public static function query($query)
    {
        $res = self::connection()->sql_query($query);

        if (!$res || self::connection()->sql_errno()) {
            // SQL statement failed
            $errorMsg = sprintf(
                'SQL Error: %s [errno: %s]',
                self::connection()->sql_error(),
                self::connection()->sql_errno()
            );

            if (defined('TYPO3_cliMode')) {
                throw new \Exception($errorMsg);
            } else {
                debug('SQL-QUERY: ' . $query, $errorMsg, __LINE__, __FILE__);
            }

            $res = null;
        }

        return $res;
    }
829797
public function scopeSort($query)
    {
        if (!$this->sorters) {

            $message = 'Please set the $sorters property.';
            throw new FilterableSortableException($message);
        }

        $this->sorters = app()->make($this->sorters);

        if (!$this->sorters instanceof QuerySorters) {

            $message = '$sorters property must be a class instance of QuerySorter.';
            throw new FilterableSortableException($message);
        }

        return $this->sorters->apply($query);
    }
834826
public function query($query) {
    if(method_exists($this->db, 'query')) {
      return $this->db->query($query);
    } else {
      throw new Exception(__METHOD__ . " not implemented");
    }
  }
879490
public function delete($query, array $options = []) {
		$this->_checkConnection();

		$defaults = [
			'justOne' => false,
			'w' => $this->_config['w'],
			'wTimeoutMS' => $this->_config['wTimeoutMS'],
			'fsync' => false
		];
		$options = array_intersect_key($options + $defaults, $defaults);
		$params = compact('query', 'options');

		return Filters::run($this, __FUNCTION__, $params, function($params) {
			$prefix = $this->_config['gridPrefix'];

			$query = $params['query'];
			$options = $params['options'];
			$args = $query->export($this, ['keys' => ['source', 'conditions']]);
			$source = $args['source'];
			$conditions = $args['conditions'];

			if ($source === "{$prefix}.files") {
				$result = $this->_deleteFile($conditions);
			} else {
				$result = $this->connection->{$args['source']}->remove($conditions, $options);
				$result = $this->_ok($result);
			}
			if ($result && $query->entity()) {
				$query->entity()->sync(null, [], ['dematerialize' => true]);
			}
			return $result;
		});
	}