-
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
Closed
Description
Symfony version(s) affected
7.4
Description
Hi there,
I think there's a little problem on mapping on proxies. In the past I had sometimes the problem, that the mapper doesn't work on existing entities. Now I think, I had found the problem: mapping to an proxy class.
How to reproduce
$melder = $this->melderRepos->findOneBy([
'turnier' => $this->turnierOeffService->getTurnier(),
'user' => $this->loginSessionService->getUser(), ]);
if (!($melder instanceof Melder))
{
$melder = (new Melder)
->setTurnier($this->turnierOeffService->getTurnier())
->setTyp(MelderTyp::VereinExtern)
->setUser($this->loginSessionService->getUser());
}
dump($melderDTO);
$this->objectMapper->map($melderDTO, $melder);
dump($melder);If the $melder is an proxy class, the mapping doesn't work.
I wanted to check that but unfortunately I was unable to disable the proxy to confirm that.
Possible Solution
I'm not able to find a solution.
Additional Context
No response