Permalink
Browse files

BackwardsCompatibilityBreak - Removed fRecordSet::countWithoutLimit()…

… and added the $ignore_limit parameter to fRecordSet::count()
  • Loading branch information...
wbond committed Oct 7, 2008
1 parent 0cc4408 commit 9ad190343dbd372e2b1797a1cb2368e54c6020b3
Showing with 4 additions and 15 deletions.
  1. +4 −15 classes/fRecordSet.php
View
@@ -446,24 +446,13 @@ private function constructWhereClause($route=NULL)
/**
* Returns the number of records in the set
*
* @param boolean $ignore_limit If set to TRUE, this method will return the number of records that would be in the set if there was no LIMIT clause
* @return integer The number of records in the set
*/
public function count()
public function count($ignore_limit=FALSE)
{
return sizeof($this->records);
}
/**
* Returns the number of records that would have been returned if the SQL statement had not used a LIMIT clause.
*
* @return integer The number of records that would have been returned if there was no LIMIT clause, or the number of records in the set if there was no LIMIT clause.
*/
public function countWithoutLimit()
{
// A query that does not use a LIMIT clause just returns the number of returned rows
if ($this->non_limited_count_sql === NULL) {
return $this->count();
if ($ignore_limit !== TRUE || $this->non_limited_count_sql === NULL) {
return sizeof($this->records);
}
if ($this->non_limited_count === NULL) {

0 comments on commit 9ad1903

Please sign in to comment.