Skip to content

Commit 3d7c8dd

Browse files
authored
Remove hasLimit() and hasOffset() usage (#310)
1 parent 41e5cd1 commit 3d7c8dd

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
- Enh #306: Minor refactoring (@Tigrov)
3838
- New #307: Add parameters `$ifExists` and `$cascade` to `CommandInterface::dropTable()` and
3939
`DDLQueryBuilderInterface::dropTable()` methods (@vjik)
40+
- Chg #310: Remove usage of `hasLimit()` and `hasOffset()` methods of `DQLQueryBuilder` class (@Tigrov)
4041

4142
## 1.3.0 March 21, 2024
4243

src/DQLQueryBuilder.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,14 @@ public function buildOrderByAndLimit(
3636

3737
$filters = [];
3838

39-
if ($this->hasOffset($offset)) {
39+
if (!empty($offset)) {
4040
$filters[] = 'rowNumId > ' .
41-
($offset instanceof ExpressionInterface ? $this->buildExpression($offset) : (string)$offset);
41+
($offset instanceof ExpressionInterface ? $this->buildExpression($offset) : (string) $offset);
4242
}
4343

44-
if ($this->hasLimit($limit)) {
44+
if ($limit !== null) {
4545
$filters[] = 'rownum <= ' .
46-
($limit instanceof ExpressionInterface ? $this->buildExpression($limit) : (string)$limit);
46+
($limit instanceof ExpressionInterface ? $this->buildExpression($limit) : (string) $limit);
4747
}
4848

4949
if (empty($filters)) {

0 commit comments

Comments
 (0)