Fix formatting and expand find() docs.

This commit is contained in:
mark_story 2013-02-26 22:00:55 -05:00
parent d9fbe5e00a
commit 1d3095ece5

View file

@ -2611,19 +2611,20 @@ class Model extends Object implements CakeEventListener {
/**
* Queries the datasource and returns a result set array.
*
* Also used to perform notation finds, where the first argument is type of find operation to perform
* Used to perform find operations, where the first argument is type of find operation to perform
* (all / first / count / neighbors / list / threaded),
* second parameter options for finding ( indexed array, including: 'conditions', 'limit',
* 'recursive', 'page', 'fields', 'offset', 'order')
* 'recursive', 'page', 'fields', 'offset', 'order', 'callbacks')
*
* Eg:
* {{{
* find('all', array(
* $model->find('all', array(
* 'conditions' => array('name' => 'Thomas Anderson'),
* 'fields' => array('name', 'email'),
* 'order' => 'field3 DESC',
* 'recursive' => 2,
* 'group' => 'type'
* 'group' => 'type',
* 'callbacks' => false,
* ));
* }}}
*
@ -2632,7 +2633,7 @@ class Model extends Object implements CakeEventListener {
* joins that should be part of the query.
*
* {{{
* find('all', array(
* $model->find('all', array(
* 'conditions' => array('name' => 'Thomas Anderson'),
* 'joins' => array(
* array(
@ -2645,7 +2646,18 @@ class Model extends Object implements CakeEventListener {
* ));
* }}}
*
* ### Disabling callbacks
*
* The `callbacks` key allows you to disable or specify the callbacks that should be run. To
* disable beforeFind & afterFind callbacks set `'callbacks' => false` in your options. You can
* also set the callbacks option to 'before' or 'after' to enable only the specified callback.
*
* ### Adding new find types
*
* Behaviors and find types can also define custom finder keys which are passed into find().
* See the documentation for custom find types
* (http://book.cakephp.org/2.0/en/models/retrieving-your-data.html#creating-custom-find-types)
* for how to implement custom find types.
*
* Specifying 'fields' for notation 'list':
*