fixes #5438, multiple binding with alias

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@7632 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
gwoo 2008-09-19 15:27:43 +00:00
parent 4f5a51d79d
commit 931d996d90

View file

@ -593,7 +593,7 @@ class Model extends Overloadable {
$className = $assoc;
}
if (!isset($this->{$assoc})) {
if (!isset($this->{$assoc}) || $this->{$assoc}->name !== $className) {
$model = array('class' => $className, 'alias' => $assoc);
if (PHP5) {
$this->{$assoc} = ClassRegistry::init($model);