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 c373293 commit c8ea8cdCopy full SHA for c8ea8cd
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