From a2d349d0994abe83f534ee16674e74bd4ba08d1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Proch=C3=A1zka?= Date: Wed, 25 Oct 2023 13:32:33 +0200 Subject: [PATCH] Convert proxy classNames to entity names --- src/Entity/Record.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Entity/Record.php b/src/Entity/Record.php index 2af5715..bc34964 100644 --- a/src/Entity/Record.php +++ b/src/Entity/Record.php @@ -9,6 +9,7 @@ use DateTime; use Doctrine\ORM\Mapping as ORM; +use Doctrine\ORM\Proxy\Proxy; use JuniWalk\Nestor\Enums\Type; use JuniWalk\Utils\Arrays; use JuniWalk\Utils\Enums\Color; @@ -122,6 +123,10 @@ public function setTarget(object $target, ?int $targetId = null): void { $this->targetId = $target->getId() ?? $targetId; $this->target = $target::class; + + if ($target instanceof Proxy) { + $this->target = get_parent_class($target); + } }