Skip to content
Permalink
Browse files

Moving code to where it actually belongs

  • Loading branch information...
lorenzo committed Sep 22, 2014
1 parent 0c2f466 commit e91831d98f966619d39ad32102429b35ee42e46a
Showing with 18 additions and 4 deletions.
  1. +0 −4 src/Datasource/QueryTrait.php
  2. +18 −0 src/ORM/Query.php
@@ -413,10 +413,6 @@ protected function _decorateResults($result) {
$result = new $decorator($result);
}
if ($this->bufferResults()) {
$result = new $decorator($result->buffered());
}
return $result;
}
@@ -34,6 +34,7 @@ class Query extends DatabaseQuery implements JsonSerializable {
use QueryTrait {
cache as private _cache;
all as private _all;
_decorateResults as private _applyDecorators;
__call as private _call;
}
@@ -804,4 +805,21 @@ public function autoFields($value = null) {
return $this;
}
/**
* Decorates the results iterator with MapReduce routines and formatters
*
* @param \Traversable $result Original results
* @return \Cake\Datasource\ResultSetDecorator
*/
protected function _decorateResults($result) {
$result = $this->_applyDecorators($result);
if ($this->bufferResults()) {
$class = $this->_decoratorClass();
$result = new $class($result->buffered());
}
return $result;
}
}

0 comments on commit e91831d

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