瀏覽代碼

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