Skip to content
Permalink
Browse files

If resultset is buffered, it is a good idea to set the internal _result

property so that the query can be iterated multiple times
  • Loading branch information...
lorenzo committed Sep 1, 2013
1 parent c0035c3 commit 88c0ab3a2f5be7840d559e8873b0b6562e915416
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/Cake/ORM/Query.php
@@ -390,15 +390,15 @@ public function execute() {
return $this->_results;
}
if ($this->_useBufferedResults) {
return $this->_applyFormatters(
return $this->_results = $this->_applyFormatters(
new BufferedResultSet($this, $this->executeStatement())
);
}
return $this->_applyFormatters(new ResultSet($this, $this->executeStatement()));
}
/**
* Compiles the SQL representation of this query ane executes it using
* Compiles the SQL representation of this query and executes it using
* the provided connection object.
*
* @return Cake\Database\StatementInterface

0 comments on commit 88c0ab3

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