Patch for CakePHP 2.2

In order to work with CakePHP 2.2 with this behavior I had to change it a little. Please merge it in another branch, because I don't see a reason that behavior should support both cakePHP 1 and 2. Or you can use it to make this behavior work with both CakePHP versions.