mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
Adding fix for #1946.
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4389 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
a47a3cbb96
commit
a83f2bf470
1 changed files with 8 additions and 11 deletions
|
@ -521,26 +521,23 @@ class Model extends Overloadable {
|
|||
* @param boolean $reset
|
||||
* @return boolean Always true
|
||||
*/
|
||||
function bindModel($params, $reset = true) {
|
||||
function bindModel($params) {
|
||||
|
||||
foreach($params as $assoc => $model) {
|
||||
if($reset === true) {
|
||||
$this->__backAssociation[$assoc] = $this->{$assoc};
|
||||
}
|
||||
$this->__backAssociation[$assoc] = $this->{$assoc};
|
||||
|
||||
foreach($model as $key => $value) {
|
||||
$assocName = $key;
|
||||
$modelName = $key;
|
||||
|
||||
if (isset($value['className'])) {
|
||||
$modelName = $value['className'];
|
||||
if (is_numeric($key)) {
|
||||
$assocName = $value;
|
||||
$value = array();
|
||||
}
|
||||
|
||||
$this->__constructLinkedModel($assocName, $modelName);
|
||||
$this->{$assoc}[$assocName] = $model[$assocName];
|
||||
$this->__generateAssociation($assoc);
|
||||
$modelName = $assocName;
|
||||
$this->{$assoc}[$assocName] = $value;
|
||||
}
|
||||
}
|
||||
$this->__createLinks();
|
||||
return true;
|
||||
}
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue