Bladeren bron

Remove temporary code as https://github.com/symfony/symfony/pull/1056 is now fixed

Thomas Rabaix 14 jaren geleden
bovenliggende
commit
83d6b1a61c
1 gewijzigde bestanden met toevoegingen van 0 en 16 verwijderingen
  1. 0 16
      Builder/ORM/FormContractor.php

+ 0 - 16
Builder/ORM/FormContractor.php

@@ -227,22 +227,6 @@ class FormContractor implements FormContractorInterface
      */
     public function addField(FormBuilder $formBuilder, FieldDescriptionInterface $fieldDescription)
     {
-        // There is a bug in the GraphWalker, so for now we always load related associations
-        // for more information : https://github.com/symfony/symfony/pull/1056
-        if ($formBuilder->getData() && in_array($fieldDescription->getType(), array(ClassMetadataInfo::ONE_TO_MANY, ClassMetadataInfo::MANY_TO_MANY, ClassMetadataInfo::MANY_TO_ONE, ClassMetadataInfo::ONE_TO_ONE ))) {
-            try {
-                $value = $fieldDescription->getValue($formBuilder->getData());
-            } catch (NoValueException $e) {
-                $value = null;
-            }
-
-            $infos = $fieldDescription->getAssociationMapping();
-            if ($value instanceof $infos['targetEntity'] && $value instanceof \Doctrine\ORM\Proxy\Proxy) {
-                $relatedId = 'get'.current($fieldDescription->getAdmin()->getModelManager()->getIdentifierFieldNames($infos['targetEntity']));
-                $value->{$relatedId}(); // force to load the lazy loading method __load in the proxy methode
-            }
-        }
-
         switch ($fieldDescription->getType()) {
             case ClassMetadataInfo::ONE_TO_MANY:
                 $this->getOneToManyField($formBuilder, $fieldDescription);