Return parts of the query on which this instance based on.

@return array $queryParts query parts; parts which have no elements will be unset
499933
public function getQueryParts()
    {
        // remove prefix information from query to be able to simply use extractGraphs on query string.
        $prefixlessQuery = preg_replace(
            '/PREFIX\s+([a-z0-9]+)\:\s*\<([a-z0-9\:\/\.\#\-]+)\>/',
            '',
            $this->getQuery()
        );

        $this->queryParts['filter_pattern'] = $this->extractFilterPattern($this->queryParts['where']);
        $this->queryParts['graphs'] = $this->extractGraphs($prefixlessQuery);
        $this->queryParts['namespaces'] = $this->extractNamespacesFromQuery($this->queryParts['where']);
        $this->queryParts['prefixes'] = $this->extractPrefixesFromQuery($this->getQuery());
        $this->queryParts['quad_pattern'] = $this->extractQuads($this->queryParts['where']);
        $this->queryParts['triple_pattern'] = $this->extractTriplePattern($this->queryParts['where']);
        $this->queryParts['variables'] = $this->extractVariablesFromQuery($this->getQuery());

        $this->unsetEmptyValues($this->queryParts);

        return $this->queryParts;
    }
311691
public function getRows()
    {
        $rows = [];
        $wheres = $this->queryBuilder->wheres ?: [];

        foreach ($wheres as $where) {

            // Skip unsupported clauses
            if (!isset($where['column'])) {
                continue;
            }

            // If it doesn't contain the table name assume it's the "FROM" table
            if (strpos($where['column'], '.') === false) {
                $where['column'] = implode('.', [$this->queryBuilder->from, $where['column']]);
            }

            list($table, $column) = $this->splitTableAndColumn($where['column']);

            // Make sure that the where clause applies for the primary key column
            if ($column !== self::PRIMARY_KEY_COLUMN) {
                continue;
            }

            // Initialize a set for the current table
            if (!isset($rows[$table])) {
                $rows[$table] = [];
            }

            // Add the rows to the current table set
            if ($where['type'] === 'Basic') {
                if ($where['operator'] === '=' && is_numeric($where['value'])) {
                    $rows[$table][] = $where['value'];
                }
            }
            else if ($where['type'] === 'In') {
                $rows[$table] += $where['values'];
            }
        }

        return $rows;
    }
347253
public function getQueryTerms()
    {
        if ($this->_signs === null) {
            return $this->_terms;
        }

        $terms = array();

        foreach ($this->_signs as $id => $sign) {
            if ($sign !== false) {
                $terms[] = $this->_terms[$id];
            }
        }

        return $terms;
    }
670792
public function extract($parts = null) {
        if ($this->isEmpty()) {
            return false;
        }

        if ($parts === null) {
            return $this->content;
        }

        if (is_array($parts)) {
            $result = array();
            foreach ($parts as $key) {
                if (isset($this->content[$key])) {
                    $result[$key] = $this->content[$key];
                }
            }

            return $result;
        }

        return isset($this->content[$parts])?$this->content[$parts]:false;
    }
202007
private function getSelectQuery()
	{
		$result = $this->getSelectClause();

		if ($join = $this->getJoinClause()) {
			$result .= ' ' . $join;
		}

		if ($where = $this->getWhereClause()) {
			$result .= ' ' . $where;
		}

		if ($groupBy = $this->getGroupByClause()) {
			$result .= ' ' . $groupBy;
		}

		if ($orderBy = $this->getOrderByClause()) {
			$result .= ' ' . $orderBy;
		}

		if ($limit = $this->getLimitClause()) {
			$result .= ' ' . $limit;
		}

		if ($offset = $this->getOffsetClause()) {
			$result .= ' ' . $offset;
		}

		return $result;
	}
754486
public function resetQueryPart($queryPartName)
    {
        $defaults = $this->defaultQueryParts();
        $this->sqlParts[$queryPartName] = $defaults[$queryPartName];

        return $this;
    }
940321
public function getAllParts()
    {
        if (!$this->kqb) {
            throw new KendoQbParserException('First use setupFilters()');
        }

        return $this->kqb->getAllParts().$this->kqb->getLimitOffset();
    }
1278863
public function selectAll()
    {
        if (is_null($this->sth)) {
            throw new QueryFailedException();
        }

        return $this->sth->fetchAll(\PDO::FETCH_OBJ);
    }
829962
public function getQueryTerms()
    {
        $terms = array();

        foreach ($this->_subqueries as $id => $subquery) {
            if ($this->_signs === null  ||  $this->_signs[$id] !== false) {
                $terms = array_merge($terms, $subquery->getQueryTerms());
            }
        }

        return $terms;
    }
622889
private function getQueryFilters()
    {
        $queries = [];

        foreach ($this->queryProviders as $queryProvider) {
            $queries[] = $queryProvider->getQuery();
        }

        return array_filter($queries);
    }
617940
public function toQuery() : array
	{
		$array = [];

		foreach (get_object_vars($this) as $name => $value)
		{
			if (null === $value)
			{
				continue;
			}

			if (is_array($value))
			{
				if (count($value))
				{
					foreach ($value as $v)
					{
						$array[] = [
							'name'     => $name . '[]',
							'contents' => $v
						];
					}
				}
			}
			else
			{
				$array[] = [
					'name'     => $name,
					'contents' => $value
				];
			}
		}

		return $array;
	}
1223164
public function getParams()
	{
		$ret = array();
		$query = $this->getComponent('query');

		if ( $query ) {
			parse_str($query, $ret);
		}

		return $ret;
	}
1213265
private function createQueryFrom(array $queryParts = [])
	{
		$rsm = new ResultSetMapping();

		return $this->entityManager->createNativeQuery(implode(' ', $queryParts), $rsm);
	}
1324115
public function getQuery()
    {
        $queryParts = array_map(function ($value) {
            return ($value instanceof Operator) ? $value->expression() : $value;
        }, $this->queryParts);

        return implode('', $queryParts);
    }
1283921
public function getParts()
    {
        $wsdlLines = $this->getWsdlLines();

        $parts = array();

        // If array is defied as inherited from array type it have only one line and looks like "Type ArrayOfType[]"
        if (sizeof($wsdlLines) == 1 && substr($wsdlLines[0], -2, 2) == '[]') {
            list($typeName, $name) = explode(" ", $wsdlLines[0]);
            $name = substr($name, 0, -2);
            $typeName .= '[]';

            $parts[$name] = $typeName;
        }

        for ($i = 1; $i < sizeof($wsdlLines) - 1; $i++) {
            $wsdlLines[$i] = trim($wsdlLines[$i]);
            list($typeName, $name) = explode(" ", substr($wsdlLines[$i], 0, strlen($wsdlLines[$i]) - 1));

            if ($this->isElementArray($name)) {
                $typeName .= '[]';
            }

            $parts[$name] = $typeName;
        }

        return $parts;
    }
904413
public function getQueryString()
    {
        $query = [];
        if (!empty($this->pagination)) {
            $query[self::PARAM_PAGINATION] = $this->pagination;
        }
        if (!empty($this->filters)) {
            $query[self::PARAM_FILTERING] = $this->filters;
        }
        foreach ($this->fields as $modelType => $fields) {
            $query[self::PARAM_FIELDSETS][$modelType] = implode(',', $fields);
        }
        $sort = [];
        foreach ($this->sorting as $key => $direction) {
            $sort[] = (1 === $direction) ? $key : sprintf('-%s', $key);
        }
        if (!empty($sort)) {
            $query[self::PARAM_SORTING] = implode(',', $sort);
        }
        return http_build_query($query);
    }
312539
public function toString()
    {
        $this->parts = array();
        $this->params = array();
        $this->assemble();
        $this->query = join(' ', $this->parts);
        if( $this->interpolation ) {
            $this->interpolateParams();
        }
        return $this->query;
    }