mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-06-18 12:43:42 +00:00
Fix different format of $results in afterFind
Refs #2529 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:
parent
c227c14bf2
commit
c246695518
4 changed files with 96 additions and 3 deletions
lib/Cake/Model
|
@ -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.
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue