diff --git a/src/Symfony/Bridge/Doctrine/Form/ChoiceList/EntityChoiceList.php b/src/Symfony/Bridge/Doctrine/Form/ChoiceList/EntityChoiceList.php index 57e57e6e25db9..50460de5777ef 100644 --- a/src/Symfony/Bridge/Doctrine/Form/ChoiceList/EntityChoiceList.php +++ b/src/Symfony/Bridge/Doctrine/Form/ChoiceList/EntityChoiceList.php @@ -218,8 +218,10 @@ public function getChoicesForValues(array $values) if (!$this->loaded) { // Optimize performance in case we have an entity loader and // a single-field identifier - if ($this->idAsValue && $this->entityLoader) { - $unorderedEntities = $this->entityLoader->getEntitiesByIds($this->idField, $values); + if ($this->idAsValue) { + $unorderedEntities = $this->entityLoader + ? $this->entityLoader->getEntitiesByIds($this->idField, $values) + : $this->em->getRepository($this->class)->findBy(array($this->idField => $values)); $entitiesByValue = array(); $entities = array();
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: