Skip to content
Permalink
Browse files

rename decorate results and decorate statement

in this way, decorateResults calls ResultSetDecorator, which is less
likely to be confusing, and _decorateStatement decorates a statement

closes #2413
  • Loading branch information...
AD7six committed Dec 3, 2013
1 parent 1439118 commit 9150a7806d04516ac2a3b322a391d0bad831c907
Showing with 7 additions and 7 deletions.
  1. +2 −2 Cake/Database/Query.php
  2. +5 −5 Cake/ORM/Query.php
@@ -204,7 +204,7 @@ public function execute() {
$query->_bindStatement($statement);
$statement->execute();
return $query->_decorateResults($statement);
return $query->_decorateStatement($statement);
}
/**
@@ -1614,7 +1614,7 @@ public function valueBinder($binder = null) {
* @param Cake\Database\Statement $statement to be decorated
* @return Cake\Database\Statement\CallbackStatement
*/
protected function _decorateResults($statement) {
protected function _decorateStatement($statement) {
foreach ($this->_resultDecorators as $f) {
$statement = new CallbackStatement($statement, $this->connection()->driver(), $f);
}
@@ -409,11 +409,11 @@ public function execute() {
return $this->_results;
}
if ($this->_useBufferedResults) {
return $this->_results = $this->_applyFormatters(
return $this->_results = $this->_decorateResults(
new BufferedResultSet($this, $this->executeStatement())
);
}
return $this->_applyFormatters(new ResultSet($this, $this->executeStatement()));
return $this->_decorateResults(new ResultSet($this, $this->executeStatement()));
}
/**
@@ -666,7 +666,7 @@ public function hydrate($enable = null) {
* @param $results Cake\ORM\ResultCollectionTrait original results
* @return Cake\ORM\ResultCollectionTrait
*/
protected function _applyFormatters($result) {
protected function _decorateResults($result) {
foreach ($this->_mapReduce as $functions) {
$result = new MapReduce($result, $functions['mapper'], $functions['reducer']);
}
@@ -685,8 +685,8 @@ protected function _applyFormatters($result) {
* @param Cake\Database\Statement $statement to be decorated
* @return Cake\Database\Statement
*/
protected function _decorateResults($statement) {
$statement = parent::_decorateResults($statement);
protected function _decorateStatement($statement) {
$statement = parent::_decorateStatement($statement);
if ($this->_loadEagerly) {
if (!($statement instanceof BufferedStatement)) {
$statement = new BufferedStatement($statement, $this->connection()->driver());

0 comments on commit 9150a78

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