Fix different format of $results in afterFind

Refs 

As of this commit, we can get consistent format of $resutls in afterFind.
And we can keep backward compatibility if Model::$useConsistentAfterFind is set to false.
This commit is contained in:
chinpei215 2014-08-11 00:21:51 +09:00
parent c227c14bf2
commit c246695518
4 changed files with 96 additions and 3 deletions
lib/Cake/Model

View file

@ -603,6 +603,25 @@ class Model extends Object implements CakeEventListener {
// @codingStandardsIgnoreEnd
/**
* If true, afterFind will be passed consistent formatted $results in case of $primary is false.
* The format will be such as the following.
*
* {{{
* $results = array(
* 0 => array(
* 'ModelName' => array(
* 'field1' => 'value1',
* 'field2' => 'value2'
* )
* )
* );
* }}}
*
* @var bool
*/
public $useConsistentAfterFind = true;
/**
* The ID of the model record that was last inserted.
*