feat: update database relation

This commit is contained in:
Maël Gangloff
2024-07-11 22:20:20 +02:00
parent bad27c7b42
commit 6aad09297f
11 changed files with 146 additions and 83 deletions

View File

@@ -3,10 +3,10 @@
namespace App\Entity;
use App\Config\EventAction;
use App\Repository\EventRepository;
use App\Repository\EntityEventRepository;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: EventRepository::class)]
#[ORM\MappedSuperclass]
class Event
{
#[ORM\Id]
@@ -20,10 +20,6 @@ class Event
#[ORM\Column]
private ?\DateTimeImmutable $date = null;
#[ORM\ManyToOne(targetEntity: Entity::class, inversedBy: 'events')]
#[ORM\JoinColumn(referencedColumnName: 'handle', nullable: false)]
private ?Entity $entity = null;
public function getId(): ?int
{
@@ -54,16 +50,4 @@ class Event
return $this;
}
public function getEntity(): ?Entity
{
return $this->entity;
}
public function setEntity(?Entity $entity): static
{
$this->entity = $entity;
return $this;
}
}