Skip to content

Commit

Permalink
Remove temporary code as symfony/symfony#1056 is now fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Rabaix committed Jul 25, 2011
1 parent fa0d187 commit 83d6b1a
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions Builder/ORM/FormContractor.php
Original file line number Diff line number Diff line change
Expand Up @@ -227,22 +227,6 @@ protected function defineManyToManyField(FormBuilder $formBuilder, FieldDescript
*/
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);
Expand Down

0 comments on commit 83d6b1a

Please sign in to comment.