Commit 74eda4b0 authored by jeroendedauw's avatar jeroendedauw

Simplify getSQLForSelect more

parent e4a8074a
......@@ -1095,9 +1095,15 @@ class QueryBuilder
. ($this->sqlParts['having'] !== null ? ' HAVING ' . ((string) $this->sqlParts['having']) : '')
. ($this->sqlParts['orderBy'] ? ' ORDER BY ' . implode(', ', $this->sqlParts['orderBy']) : '');
return ($this->maxResults === null && $this->firstResult == null)
? $query
: $this->connection->getDatabasePlatform()->modifyLimitQuery($query, $this->maxResults, $this->firstResult);
if ($this->isLimitQuery()) {
return $this->connection->getDatabasePlatform()->modifyLimitQuery(
$query,
$this->maxResults,
$this->firstResult
);
}
return $query;
}
private function getFromClauses()
......@@ -1129,6 +1135,11 @@ class QueryBuilder
}
}
private function isLimitQuery()
{
return $this->maxResults !== null || $this->firstResult != null;
}
/**
* Converts this instance into an INSERT string in SQL.
*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment