8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7b9bc80 commit a108445Copy full SHA for a108445
src/Symfony/Bridge/Doctrine/Form/ChoiceList/EntityChoiceList.php
@@ -218,8 +218,10 @@ public function getChoicesForValues(array $values)
218
if (!$this->loaded) {
219
// Optimize performance in case we have an entity loader and
220
// a single-field identifier
221
- if ($this->idAsValue && $this->entityLoader) {
222
- $unorderedEntities = $this->entityLoader->getEntitiesByIds($this->idField, $values);
+ if ($this->idAsValue) {
+ $unorderedEntities = $this->entityLoader
223
+ ? $this->entityLoader->getEntitiesByIds($this->idField, $values)
224
+ : $this->em->getRepository($this->class)->findBy(array($this->idField => $values));
225
$entitiesByValue = array();
226
$entities = array();
227
0 commit comments