Cake\ORM\Query::_decorateResults PHP Method

_decorateResults() protected method

Decorates the results iterator with MapReduce routines and formatters
protected _decorateResults ( Traversable $result ) : Cake\Datasource\ResultSetInterface
$result Traversable Original results
return Cake\Datasource\ResultSetInterface
    protected function _decorateResults($result)
    {
        $result = $this->_applyDecorators($result);
        if (!$result instanceof ResultSet && $this->bufferResults()) {
            $class = $this->_decoratorClass();
            $result = new $class($result->buffered());
        }
        return $result;
    }