Skip to content
Permalink
Browse files

Enhancement to paginator

No point in finding the count (via model) if the returned result count
is less than our limit. We then know that the count is the count of our
results
  • Loading branch information...
eagerterrier authored and markstory committed Apr 16, 2014
1 parent 89cd114 commit 296ea215b19dcafa06208b258ae7d41c27bd352e
Showing with 2 additions and 0 deletions.
  1. +2 −0 lib/Cake/Controller/Component/PaginatorComponent.php
@@ -202,6 +202,8 @@ public function paginate($object = null, $scope = array(), $whitelist = array())
$count = 0;
} elseif ($object->hasMethod('paginateCount')) {
$count = $object->paginateCount($conditions, $recursive, $extra);
} elseif (count($results)<$limit) {
$count = count($results); // no point in finding the count if it's less than our limit
} else {
$parameters = compact('conditions');
if ($recursive != $object->recursive) {

0 comments on commit 296ea21

Please sign in to comment.
You can’t perform that action at this time.