Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/Symfony/Bridge/Doctrine/Form/Type/DoctrineType.php
Original file line number Diff line number Diff line change
Expand Up @@ -280,4 +280,9 @@ public function getParent()
{
return 'Symfony\Component\Form\Extension\Core\Type\ChoiceType';
}

public function reset()
{
$this->choiceLoaders = array();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're throwing away all choice loaders. Wouldn't it be enough to iterate over all choice loaders and reset the $choiceList property of each of them?

Copy link
Member Author

@nicolas-grekas nicolas-grekas Sep 18, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at the code, I think it's fine this way: clearing DoctrineChoiceLoader::$choiceList would require more CPU here, but wouldn't save much on new iterations.

}
}