cakephp/cakephp — pull request #2684 by lorenzo (2014-01-19 20:04:03+00:00)
Title: 3.0 result formatters

This implements query result formatters as a way to simplify some `afterFind` tasks. The benefit of using `Query::formatResults` over just calling the formatting functions directly is that you can stack formatter before the query is executed and that you have full control over the full results and what you want to return.

Also added `Collection::combine()` and `Collection::nest()` containing the same logic that was implemented in the table class. I feel this helped keeping the Table class leaner and more focused on what it actually does.

Implementing this allowed me to finish the composite primary keys ticket as now `find('list')` and `find('threaded')` work correctly with composite keys.

This also paves the way for implementing `TranslateBehavior` as it required some architecture for running simpler afterFind than with using mapReduce.

closes https://github.com/cakephp/cakephp/issues/2412