@@ -1493,7 +1493,8 @@ public function orderBy(string $orderBy, string $direction = '', ?bool $escape =
1493
1493
*/
1494
1494
public function limit (?int $ value = null , ?int $ offset = 0 )
1495
1495
{
1496
- if (config (Feature::class)->limitZeroAsAll && $ value === 0 ) {
1496
+ $ limitZeroAsAll = config (Feature::class)->limitZeroAsAll ?? true ;
1497
+ if ($ limitZeroAsAll && $ value === 0 ) {
1497
1498
$ value = null ;
1498
1499
}
1499
1500
@@ -1614,7 +1615,8 @@ protected function compileFinalQuery(string $sql): string
1614
1615
*/
1615
1616
public function get (?int $ limit = null , int $ offset = 0 , bool $ reset = true )
1616
1617
{
1617
- if (config (Feature::class)->limitZeroAsAll && $ limit === 0 ) {
1618
+ $ limitZeroAsAll = config (Feature::class)->limitZeroAsAll ?? true ;
1619
+ if ($ limitZeroAsAll && $ limit === 0 ) {
1618
1620
$ limit = null ;
1619
1621
}
1620
1622
@@ -1751,7 +1753,8 @@ public function getWhere($where = null, ?int $limit = null, ?int $offset = 0, bo
1751
1753
$ this ->where ($ where );
1752
1754
}
1753
1755
1754
- if (config (Feature::class)->limitZeroAsAll && $ limit === 0 ) {
1756
+ $ limitZeroAsAll = config (Feature::class)->limitZeroAsAll ?? true ;
1757
+ if ($ limitZeroAsAll && $ limit === 0 ) {
1755
1758
$ limit = null ;
1756
1759
}
1757
1760
@@ -2473,7 +2476,8 @@ public function update($set = null, $where = null, ?int $limit = null): bool
2473
2476
$ this ->where ($ where );
2474
2477
}
2475
2478
2476
- if (config (Feature::class)->limitZeroAsAll && $ limit === 0 ) {
2479
+ $ limitZeroAsAll = config (Feature::class)->limitZeroAsAll ?? true ;
2480
+ if ($ limitZeroAsAll && $ limit === 0 ) {
2477
2481
$ limit = null ;
2478
2482
}
2479
2483
@@ -2518,7 +2522,8 @@ protected function _update(string $table, array $values): string
2518
2522
$ valStr [] = $ key . ' = ' . $ val ;
2519
2523
}
2520
2524
2521
- if (config (Feature::class)->limitZeroAsAll ) {
2525
+ $ limitZeroAsAll = config (Feature::class)->limitZeroAsAll ?? true ;
2526
+ if ($ limitZeroAsAll ) {
2522
2527
return 'UPDATE ' . $ this ->compileIgnore ('update ' ) . $ table . ' SET ' . implode (', ' , $ valStr )
2523
2528
. $ this ->compileWhereHaving ('QBWhere ' )
2524
2529
. $ this ->compileOrderBy ()
@@ -2794,7 +2799,8 @@ public function delete($where = '', ?int $limit = null, bool $resetData = true)
2794
2799
2795
2800
$ sql = $ this ->_delete ($ this ->removeAlias ($ table ));
2796
2801
2797
- if (config (Feature::class)->limitZeroAsAll && $ limit === 0 ) {
2802
+ $ limitZeroAsAll = config (Feature::class)->limitZeroAsAll ?? true ;
2803
+ if ($ limitZeroAsAll && $ limit === 0 ) {
2798
2804
$ limit = null ;
2799
2805
}
2800
2806
@@ -3064,7 +3070,8 @@ protected function compileSelect($selectOverride = false): string
3064
3070
. $ this ->compileWhereHaving ('QBHaving ' )
3065
3071
. $ this ->compileOrderBy ();
3066
3072
3067
- if (config (Feature::class)->limitZeroAsAll ) {
3073
+ $ limitZeroAsAll = config (Feature::class)->limitZeroAsAll ?? true ;
3074
+ if ($ limitZeroAsAll ) {
3068
3075
if ($ this ->QBLimit ) {
3069
3076
$ sql = $ this ->_limit ($ sql . "\n" );
3070
3077
}
0 commit comments