浏览代码

fix regression with getParentFieldDescription method

Thomas Rabaix 14 年之前
父节点
当前提交
84694e0c8e
共有 1 个文件被更改,包括 4 次插入3 次删除
  1. 4 3
      Model/ORM/ModelManager.php

+ 4 - 3
Model/ORM/ModelManager.php

@@ -118,9 +118,11 @@ class ModelManager implements ModelManagerInterface
 
         $metadata = $this->getMetadata($class);
 
+        $associatingMapping = $metadata->associationMappings[$parentAssociationMapping];
+
         $fieldDescription = $this->getNewFieldDescriptionInstance($class, $fieldName);
-        $fieldDescription[$fieldName]->setName($metadata->associationMappings[$parentAssociationMapping]);
-        $fieldDescription[$fieldName]->setAssociationMapping($metadata->associationMappings);
+        $fieldDescription->setName($parentAssociationMapping);
+        $fieldDescription->setAssociationMapping($associatingMapping);
 
         return $fieldDescription;
     }
@@ -175,7 +177,6 @@ class ModelManager implements ModelManagerInterface
      */
     public function getModelInstance($class)
     {
-
         return new $class;
     }