Skip to content

Commit

Permalink
Fix wrong usage of property accessor
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathan committed Jun 21, 2024
1 parent 0c4d979 commit 461344e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Transformer/CollectionTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ public function transform(mixed $data, array $options, object $targetObject, obj
foreach ($data as $datum) {
$target = null;
if ($propertyAccessor->isReadable($datum, 'id')) {
$target = null !== $propertyAccessor->getValue($datum, 'id') ? $this->em->getRepository($fcqn)->find($datum->id) : $target;
$id = $propertyAccessor->getValue($datum, 'id');
$target = null !== $id ? $this->em->getRepository($fcqn)->find($id) : $target;
}

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

0 comments on commit 461344e

Please sign in to comment.