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:
phpnut 2007-02-01 18:37:42 +00:00
parent a47a3cbb96
commit a83f2bf470

View file

@ -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;
}
/**