Sfoglia il codice sorgente

fix regression with getParentFieldDescription method

Thomas Rabaix 14 anni fa
parent
commit
84694e0c8e
1 ha cambiato i file con 4 aggiunte e 3 eliminazioni
  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;
     }
     }