Skip to content

Commit

Permalink
Try
Browse files Browse the repository at this point in the history
  • Loading branch information
VincentLanglet committed Aug 25, 2020
1 parent 6a8ad35 commit 580db19
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Form/DataTransformer/ModelToIdPropertyTransformer.php
Expand Up @@ -97,7 +97,7 @@ public function reverseTransform($value)
continue;
}

$collection[] = $this->modelManager->find($this->className, $id);
$collection->add($this->modelManager->find($this->className, $id));
}

return $collection;
Expand Down
2 changes: 1 addition & 1 deletion src/Form/DataTransformer/ModelsToArrayTransformer.php
Expand Up @@ -153,7 +153,7 @@ public function reverseTransform($keys)
// optimize this into a SELECT WHERE IN query
foreach ($keys as $key) {
if ($model = $this->modelManager->find($this->class, $key)) {
$collection[] = $model;
$collection->add($model);
} else {
$notFound[] = $key;
}
Expand Down

0 comments on commit 580db19

Please sign in to comment.