From fb4528b8c79fca5c0d3e530ae8aee9a9f63fcd4d Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Thu, 18 Jun 2015 12:42:56 +0930 Subject: [PATCH] Get rid of total count from UserSearcher Same reasoning as 320180efc469916343d4ba425fff173b839a19d0 --- .../core/src/Core/Search/Users/UserSearchResults.php | 10 +--------- framework/core/src/Core/Search/Users/UserSearcher.php | 4 +--- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/framework/core/src/Core/Search/Users/UserSearchResults.php b/framework/core/src/Core/Search/Users/UserSearchResults.php index 6c25282d0..ece38a80b 100644 --- a/framework/core/src/Core/Search/Users/UserSearchResults.php +++ b/framework/core/src/Core/Search/Users/UserSearchResults.php @@ -6,13 +6,10 @@ class UserSearchResults protected $areMoreResults; - protected $total; - - public function __construct($users, $areMoreResults, $total) + public function __construct($users, $areMoreResults) { $this->users = $users; $this->areMoreResults = $areMoreResults; - $this->total = $total; } public function getUsers() @@ -20,11 +17,6 @@ class UserSearchResults return $this->users; } - public function getTotal() - { - return $this->total; - } - public function areMoreResults() { return $this->areMoreResults; diff --git a/framework/core/src/Core/Search/Users/UserSearcher.php b/framework/core/src/Core/Search/Users/UserSearcher.php index 9559d47f3..dd3ff77e1 100644 --- a/framework/core/src/Core/Search/Users/UserSearcher.php +++ b/framework/core/src/Core/Search/Users/UserSearcher.php @@ -50,8 +50,6 @@ class UserSearcher implements SearcherInterface $this->gambits->apply($criteria->query, $this); - $total = $this->query->count(); - $sort = $criteria->sort ?: $this->defaultSort; foreach ($sort as $field => $order) { @@ -81,6 +79,6 @@ class UserSearcher implements SearcherInterface $users->load($load); - return new UserSearchResults($users, $areMoreResults, $total); + return new UserSearchResults($users, $areMoreResults); } }