Skip to content

Commit

Permalink
Convert proxy classNames to entity names
Browse files Browse the repository at this point in the history
  • Loading branch information
juniwalk authored Oct 25, 2023
1 parent a21d3f4 commit a2d349d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Entity/Record.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}
}


Expand Down

0 comments on commit a2d349d

Please sign in to comment.