Skip to content

Commit

Permalink
optional reset in countAll (as is in countAllResults)
Browse files Browse the repository at this point in the history
  • Loading branch information
nowackipawel authored Sep 13, 2018
1 parent 3aa229e commit 745aa7c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions system/Database/BaseBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -1396,11 +1396,12 @@ public function get(int $limit = null, int $offset = 0, $returnSQL = false)
* Generates a platform-specific query string that counts all records in
* the specified database
*
* @param bool $reset Are we want to clear query builder values.
* @param bool $test Are we running automated tests?
*
* @return int
*/
public function countAll($test = false)
public function countAll($reset = true, $test = false)
{
$table = $this->QBFrom[0];

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

$query = $query->getRow();
$this->resetSelect();

if ($reset === true)
{
$this->resetSelect();
}

return (int) $query->numrows;
}
Expand Down

0 comments on commit 745aa7c

Please sign in to comment.