Skip to content

Commit a363e0a

Browse files
authored
Update BaseBuilder.php
1 parent 19b13b9 commit a363e0a

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

system/Database/BaseBuilder.php

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1371,19 +1371,23 @@ public function getCompiledSelect($reset = true)
13711371
*
13721372
* @param int $limit The limit clause
13731373
* @param int $offset The offset clause
1374-
* @param bool $returnSQL If true, returns the generate SQL, otherwise executes the query.
1374+
* @param bool $returnSQL If true, returns the generate SQL, otherwise executes the query.
1375+
* @param bool $reset Are we want to clear query builder values?
13751376
*
13761377
* @return ResultInterface
13771378
*/
1378-
public function get(int $limit = null, int $offset = 0, $returnSQL = false)
1379+
public function get(int $limit = null, int $offset = 0, $returnSQL = false, $reset = true)
13791380
{
13801381
if ( ! is_null($limit))
13811382
{
13821383
$this->limit($limit, $offset);
13831384
}
13841385
$result = $returnSQL ? $this->getCompiledSelect() : $this->db->query($this->compileSelect(), $this->binds);
13851386

1386-
$this->resetSelect();
1387+
if($reset == true)
1388+
{
1389+
$this->resetSelect();
1390+
}
13871391

13881392
return $result;
13891393
}
@@ -1396,8 +1400,8 @@ public function get(int $limit = null, int $offset = 0, $returnSQL = false)
13961400
* Generates a platform-specific query string that counts all records in
13971401
* the specified database
13981402
*
1399-
* @param bool $reset Are we want to clear query builder values.
1400-
* @param bool $test Are we running automated tests?
1403+
* @param bool $reset Are we want to clear query builder values?
1404+
* @param bool $test Are we running automated tests?
14011405
*
14021406
* @return int
14031407
*/

0 commit comments

Comments
 (0)