Get query

@return query
501221
@NotNull
    @Size(max = 1000)
    @ApiModelProperty(required = true, value = "")
    public String getQuery() {
        return query;
    }
494879
public function getQuery()
	{
		if (!$this->query) {
			$this->query = new Query($this->driver, $this->preprocessor);
		}

		return $this->query;
	}
302622
public function getQuery()
    {
        $query = new AVQuery($this->targetClassName);
        $query->relatedTo('object', $this->parent->_toPointer());
        $query->relatedTo('key', $this->key);

        return $query;
    }
335992
public function getQuery() {
		$output	= $this->get('output');
		
		try  {
			$this->set('output', SQLAdapter::SQLQUERY);
			$result = $this->run();
		} catch( \Exception $e ) {
			
		}
		
		$this->set('output', $output);
		
		if( isset($e) ) {
			throw $e;
		}
		
		return $result;
	}
603117
public function query()
	{
		if ($this->result === null) {
			$this->before_called = true;
			foreach ($this->before_query as $callable) {
				$callable();
			}
			try {
				$this->result = $this->query->query();
				$this->result->setFetchMode(\PDO::FETCH_ASSOC);

			}
			catch (\Smalldb\Flupdo\FlupdoSqlException $ex) {
				error_log("Failed SQL query:\n".$this->query->getSqlQuery());
				error_log("Parameters of failed SQL query:\n".$this->query->getSqlParams());
				throw $ex;
			}
		} else {
			throw new RuntimeException('Query already performed.');
		}
		return $this->result;
	}
211098
public function getQuery()
    {
        $joins = empty($this->joins) ? '' : implode(' ', $this->joins);
        $where = empty($this->where) ? '' : 'WHERE '.implode(' AND ', $this->where);
        $sort = empty($this->sortBy) ? '' : 'ORDER BY '.implode(', ', $this->sortBy);
        $limit = is_null($this->page) ? '' : 'LIMIT ' . $this->page .',' .$this->length;
        $group = empty($this->group) ? '' : 'GROUP BY ' . implode(', ', $this->group);
        
        $query = sprintf(
            'SELECT %s FROM %s %s %s %s %s %s;',
            $this->select,
            $this->from,
            $joins,
            $where,
            $group,
            $sort,
            $limit
        );
        
        return str_replace('  ', ' ', $query);
    }
1301597
protected function getQuery() {
        $query = '';

        foreach ($this->config['args'] as $index => $arg) {
            if (array_key_exists('command', $this->config) &&
                $arg === $this->config['command'] &&
                array_key_exists(($index + 1), $this->config['args'])) {
                $query = $this->config['args'][$index + 1];
                break;
            }
        }

        return $query;
    }
971421
protected function _getQuery()
    {
        $oCat = oxNew(\OxidEsales\Eshop\Application\Model\Category::class);
        $oCat->setLanguage(\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('editlanguage'));

        $sCategoriesTable = $oCat->getViewName();

        return " from $sCategoriesTable where " . $oCat->getSqlActiveSnippet();
    }
327750
public function query()
    {
        $params = func_get_args();
        $query = array_shift($params);

        // Support one argument of type array, instead of n arguments
        if (count($params) == 1 && is_array($params[0])) {
            $params = $params[0];
        }

        return $this->_query($query, 0, 0, $params);
    }
418082
public function get()
    {
        try {
            if (!is_null($this->query)) {
                $statement = $this->connect->prepare($this->query);
                $statement->execute();
                return $statement->fetchAll();
            }

        } catch (\Exception $exception) {
            var_dump($exception->getMessage());
        }
    }
144957
public function getQuery($new = false)
    {
        if (!$this->query || $new) {
            $this->query = $this->db->getQuery(true);
        }

        return $this->query;
    }
734424
public function getQuery() 
    {
        $qb = $this->getQueryBuilder();
        $query = $qb->getQuery();
        $query->setFirstResult($this->getParam('offset', 0));
        $query->setMaxResults($this->getParam('limit', 30));
        
        return $query;
    }
638751
public function get()
    {
        // Define columns
        $columns = count($this->columns)? $this->getColumnsString() : $this->table . '.*';

        // Define root
        $root = 'SELECT ' . $columns . ' FROM ' . $this->table;

        // Define joins
        $joins = count($this->joins)? $this->getJoinString() : '';

        // Define where conditions
        $where = $this->getWhereString();

        // Define where in conditions
        $whereIn = $this->getWhereInString();

        // Define group by
        $groupBy = ($this->groupBy)? 'GROUP BY ' . $this->groupBy : '';

        // Define order
        $orderBy = ($this->orderBy)? $this->getOrderByString() : '';

        // Define limit
        $limit = 'LIMIT ' . $this->offset . ',' . $this->limit;

        // Build query
        $this->query = implode(' ', [$root, $joins, $where, $whereIn, $groupBy, $orderBy, $limit]);

        // Debug
        if ($this->app->config('queries.log')) {
            file_put_contents($this->app->config('queries.log'), date('Y-m-d h:i:s') . ' - ' . $this->query . "\r\n", FILE_APPEND);
        }

        // Prepare statement
        $this->statement = $this->pdo->prepare($this->query);

        // Bind where values
        if (count($this->wheres)) {
            $this->bindWheres();
        }

        // Execute statement
        if (!$this->statement->execute()) {
            throw new \PDOException('Error reading from database', 500);
        }

        // Return results
        $result = $this->statement->fetchAll(\PDO::FETCH_ASSOC);

        // Reset
        $this->reset();

        // Return result
        return $result;
    }
970161
final public function getQuery()
    {
        if (null === $this->query) {

            $this->query = $this->buildQuery();

            // Apply conditions.
            foreach ($this->conditions as $statement => $value) {
                $this->applyOperator($this->query, $statement, $value);
            }

            $limit = $this->getLimit();

            if (CursorInterface::LIMIT_NONE !== $limit) {
                $this->query->range($this->getOffset(), $limit);
            }
        }

        return $this->query;
    }
829957
public function getQuery()
    {
        if (is_null($this->_sQuery)) {
            $query = "";
            if ($params = $this->getParameters()) {
                $params = $this->_prepareQueryParameters($params);
                $query = http_build_query($params, "", "&");
            }
            $this->setQuery($query);
        }

        return $this->_sQuery;
    }
318343
public function get()
	{
		// Get the columns
		$columns = $this->select();

		// Start building the query
		$select = $columns;
		if ($this->use_subquery())
		{
			$select = array();
			foreach ($columns as $c)
			{
				$select[] = $c[0];
			}
		}

		$query = call_fuel_func_array('DB::select', $select);

		// Set from view/table
		$query->from(array($this->_table(), $this->alias));

		// Build the query further
		$tmp     = $this->build_query($query, $columns);
		$query   = $tmp['query'];
		$models  = $tmp['models'];

		// Make models hierarchical
		foreach ($models as $name => $values)
		{
			if (strpos($name, '.'))
			{
				unset($models[$name]);
				$rels = explode('.', $name);
				$ref =& $models[array_shift($rels)];
				foreach ($rels as $rel)
				{
					empty($ref['models']) and $ref['models'] = array();
					empty($ref['models'][$rel]) and $ref['models'][$rel] = array();
					$ref =& $ref['models'][$rel];
				}
				$ref = $values;
			}
		}

		$rows = $query->execute($this->connection)->as_array();
		$result = array();
		$model = $this->model;
		$select = $this->select();
		$primary_key = $model::primary_key();
		foreach ($rows as $id => $row)
		{
			$this->hydrate($row, $models, $result, $model, $select, $primary_key);
			unset($rows[$id]);
		}

		// It's all built, now lets execute and start hydration
		return $result;
	}
1221906
public function create(): Query
    {
        $query = static::new()->scope(...$this->getScopes());

        if ($this->repository) {
            return $query->from($this->repository);
        }

        return $query;
    }