Created
July 12, 2013 20:38
-
-
Save nclundsten/5987648 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[nlundsten@localhost zendframework]$ git diff 1b43cd688b 570778c77eb7fbc6a9c80 library/Zend/Paginator/Adapter/DbSelect.php | |
diff --git a/library/Zend/Paginator/Adapter/DbSelect.php b/library/Zend/Paginator/Adapter/DbSelect.php | |
index 92c7b53..c9ade72 100644 | |
--- a/library/Zend/Paginator/Adapter/DbSelect.php | |
+++ b/library/Zend/Paginator/Adapter/DbSelect.php | |
@@ -103,22 +103,15 @@ class DbSelect implements AdapterInterface | |
} | |
$select = clone $this->select; | |
- $select->reset(Select::COLUMNS); | |
$select->reset(Select::LIMIT); | |
$select->reset(Select::OFFSET); | |
$select->reset(Select::ORDER); | |
- $select->reset(Select::GROUP); | |
- // get join information, clear, and repopulate without columns | |
- $joins = $select->getRawState(Select::JOINS); | |
- $select->reset(Select::JOINS); | |
- foreach ($joins as $join) { | |
- $select->join($join['name'], $join['on'], array(), $join['type']); | |
- } | |
- | |
- $select->columns(array('c' => new Expression('COUNT(1)'))); | |
+ $countSelect = new Select; | |
+ $countSelect->columns(array('c' => new Expression('COUNT(1)'))); | |
+ $countSelect->from(array('original_select' => $select)); | |
- $statement = $this->sql->prepareStatementForSqlObject($select); | |
+ $statement = $this->sql->prepareStatementForSqlObject($countSelect); | |
$result = $statement->execute(); | |
$row = $result->current(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment