From b7617fa5d390a6e08725b0ffb73854c2a60740e9 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 64e6b7d26cdd0d0aab2e73e0b1d6e5dd5fc9b114 --- src/Core/Search/Users/UserSearchResults.php | 10 +--------- src/Core/Search/Users/UserSearcher.php | 4 +--- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/src/Core/Search/Users/UserSearchResults.php b/src/Core/Search/Users/UserSearchResults.php index 6c25282d0..ece38a80b 100644 --- a/src/Core/Search/Users/UserSearchResults.php +++ b/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/src/Core/Search/Users/UserSearcher.php b/src/Core/Search/Users/UserSearcher.php index 9559d47f3..dd3ff77e1 100644 --- a/src/Core/Search/Users/UserSearcher.php +++ b/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); } }