Skip to content

Commit 745aa7c

Browse files
authored
optional reset in countAll (as is in countAllResults)
1 parent 3aa229e commit 745aa7c

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

system/Database/BaseBuilder.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1396,11 +1396,12 @@ public function get(int $limit = null, int $offset = 0, $returnSQL = false)
13961396
* Generates a platform-specific query string that counts all records in
13971397
* the specified database
13981398
*
1399+
* @param bool $reset Are we want to clear query builder values.
13991400
* @param bool $test Are we running automated tests?
14001401
*
14011402
* @return int
14021403
*/
1403-
public function countAll($test = false)
1404+
public function countAll($reset = true, $test = false)
14041405
{
14051406
$table = $this->QBFrom[0];
14061407

@@ -1419,7 +1420,11 @@ public function countAll($test = false)
14191420
}
14201421

14211422
$query = $query->getRow();
1422-
$this->resetSelect();
1423+
1424+
if ($reset === true)
1425+
{
1426+
$this->resetSelect();
1427+
}
14231428

14241429
return (int) $query->numrows;
14251430
}

0 commit comments

Comments
 (0)