cakephp/cakephp — pull request #2521 by lorenzo (2013-12-21 17:54:21+00:00)
Title: 3.0 simplify find

This PR contains a small change to `Table::find()` and introduces `Table::get()`. Now `find()` can work with no arguments, it will just assume that you want a findAll.You can also provide an array as first argument, in which case it will also asume findAll and use the first argument as $options. I consider this reduces repetition when constantly using `find()` in your app, which is something I started to get tired of in 2.x

With the addition of `Table::get()` we have an alternative for `Model::read()` without all the evil. This is a shortcut method for quickly returning an entity matched by primary key. If the record cannot be found, it will throw an exception. This is particularly handy for repetitive tasks such as coding a `view`, `edit` or `delete` action where the record must be fetched before doing anything with it or throw a not found exception otherwise. It also relieves a bit the end user of having to type a rather verbose `$this->Articles->find('all')->where([id => $id])->first()`