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); + } }