@@ -17,7 +17,7 @@ system.
1717
1818.. contents ::
1919 :local:
20- :depth: 1
20+ :depth: 2
2121
2222*************************
2323Loading the Query Builder
@@ -511,29 +511,34 @@ The second parameter lets you set a result offset.
511511
512512 $builder->limit(10, 20); // Produces: LIMIT 20, 10 (in MySQL. Other databases have slightly different syntax)
513513
514+
514515**$builder->countAllResults() **
515516
516517Permits you to determine the number of rows in a particular Query
517518Builder query. Queries will accept Query Builder restrictors such as
518519``where() ``, ``orWhere() ``, ``like() ``, ``orLike() ``, etc. Example::
519520
520- echo $builder->countAllResults('my_table' ); // Produces an integer, like 25
521+ echo $builder->countAllResults(); // Produces an integer, like 25
521522 $builder->like('title', 'match');
522523 $builder->from('my_table');
523524 echo $builder->countAllResults(); // Produces an integer, like 17
524525
525526However, this method also resets any field values that you may have passed
526527to ``select() ``. If you need to keep them, you can pass ``FALSE `` as the
527- second parameter::
528+ first parameter.
528529
529- echo $builder->countAllResults('my_table', FALSE);
530+ echo $builder->countAllResults(false); // Produces an integer, like 17
530531
531532**$builder->countAll() **
532533
533534Permits you to determine the number of rows in a particular table.
534- Submit the table name in the first parameter. Example::
535+ Example::
535536
536- echo $builder->countAll('my_table'); // Produces an integer, like 25
537+ echo $builder->countAll(); // Produces an integer, like 25
538+
539+ As is in countAllResult method, this method resets any field values that you may have passed
540+ to ``select() `` as well. If you need to keep them, you can pass ``FALSE `` as the
541+ first parameter.
537542
538543**************
539544Query grouping
@@ -994,6 +999,15 @@ Class Reference
994999 Generates a platform-specific query string that counts
9951000 all records returned by an Query Builder query.
9961001
1002+ .. php :method :: countAll([$reset = TRUE])
1003+
1004+ :param bool $reset: Whether to reset values for SELECTs
1005+ :returns: Number of rows in the query result
1006+ :rtype: int
1007+
1008+ Generates a platform-specific query string that counts
1009+ all records returned by an Query Builder query.
1010+
9971011 .. php :method :: get([$limit = NULL[, $offset = NULL]])
9981012
9991013 :param int $limit: The LIMIT clause
0 commit comments