cakephp/cakephp — pull request #5118 by lorenzo (2014-11-09 13:38:49+00:00)
Title: 3.0 reliable beforefind

The Model.beforeFind event is now triggered in Query::sql(), this has a couple advantages:

* Calling `$query->sql()` for debugging will now contain the full actual query to be executed
* Queries used as sub-expressions (like in unions) will contain modifications made by behaviors or other callbacks.

Refs https://github.com/cakephp/cakephp/issues/5115