cakephp/cakephp — pull request #2877 by lorenzo (2014-02-20 20:49:36+00:00)
Title: 3.0 query abstraction

This moves most of `Cake\ORM\Query` into `Cake\Datasource\QueryTrait` and generalizes the code in `QueryCacher` to be able to cache any type of passed query.

The code inside query was rather generic as it only dealt with getting results and decorating them with one or multiple special decorators, so it was quite easy to extract without major modifications.

I'm working on a Elastic Search datasource and I've used successfully this code to build a working prototype. I was thinking in making it a cakephp official plugin, bad idea?