cakephp/cakephp — pull request #2551 by markstory (2013-12-26 03:05:04+00:00)
Title: Fix issues in ORM\Query

As I'm writing the docs for the query builder I ran into a few issues that I've attempted to solve:

* A ResultSet should not be returned for non-select type queries.
* The Model.beforeFind event should not be triggered when doing insert, delete, or update queries.
* The return type of ORM\Query::execute() can now return either a ResultSet or a StatementInterface. This accounts for the various kinds of queries that can be run. We might want to further separate results from executing queries. Perhaps having fetch()/get() get results and execute() get statements.
* Split resultset building from query execution. This will help make building cachable finders easier.