Skip to content

Commit 8c21743

Browse files
authored
Merge pull request #33 from Sinjonathan/main
Fix wrong usage of property accessor
2 parents 0c4d979 + 461344e commit 8c21743

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Transformer/CollectionTransformer.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ public function transform(mixed $data, array $options, object $targetObject, obj
5656
foreach ($data as $datum) {
5757
$target = null;
5858
if ($propertyAccessor->isReadable($datum, 'id')) {
59-
$target = null !== $propertyAccessor->getValue($datum, 'id') ? $this->em->getRepository($fcqn)->find($datum->id) : $target;
59+
$id = $propertyAccessor->getValue($datum, 'id');
60+
$target = null !== $id ? $this->em->getRepository($fcqn)->find($id) : $target;
6061
}
6162

6263
$target = $this->mappingService->mapToTarget($datum, $target);

0 commit comments

Comments
 (0)