2024-07-11 17:01:16 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Entity;
|
|
|
|
|
|
|
|
|
|
use App\Config\EventAction;
|
2024-07-11 18:29:22 +02:00
|
|
|
use App\Repository\EventRepository;
|
2024-07-11 17:01:16 +02:00
|
|
|
use Doctrine\ORM\Mapping as ORM;
|
|
|
|
|
|
2024-07-11 18:29:22 +02:00
|
|
|
#[ORM\Entity(repositoryClass: EventRepository::class)]
|
|
|
|
|
class Event
|
2024-07-11 17:01:16 +02:00
|
|
|
{
|
2024-07-11 18:29:22 +02:00
|
|
|
#[ORM\Id]
|
|
|
|
|
#[ORM\GeneratedValue]
|
|
|
|
|
#[ORM\Column]
|
|
|
|
|
private ?int $id = null;
|
|
|
|
|
|
|
|
|
|
#[ORM\Column(enumType: EventAction::class)]
|
|
|
|
|
private ?EventAction $action = null;
|
|
|
|
|
|
2024-07-11 17:01:16 +02:00
|
|
|
#[ORM\Column]
|
|
|
|
|
private ?\DateTimeImmutable $date = null;
|
|
|
|
|
|
2024-07-11 18:29:22 +02:00
|
|
|
#[ORM\ManyToOne(targetEntity: Entity::class, inversedBy: 'events')]
|
2024-07-11 17:01:16 +02:00
|
|
|
#[ORM\JoinColumn(referencedColumnName: 'handle', nullable: false)]
|
2024-07-11 18:29:22 +02:00
|
|
|
private ?Entity $entity = null;
|
2024-07-11 17:01:16 +02:00
|
|
|
|
|
|
|
|
|
2024-07-11 18:29:22 +02:00
|
|
|
public function getId(): ?int
|
2024-07-11 17:01:16 +02:00
|
|
|
{
|
2024-07-11 18:29:22 +02:00
|
|
|
return $this->id;
|
2024-07-11 17:01:16 +02:00
|
|
|
}
|
|
|
|
|
|
2024-07-11 18:29:22 +02:00
|
|
|
public function getAction(): ?EventAction
|
2024-07-11 17:01:16 +02:00
|
|
|
{
|
2024-07-11 18:29:22 +02:00
|
|
|
return $this->action;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function setAction(EventAction $action): static
|
|
|
|
|
{
|
|
|
|
|
$this->action = $action;
|
2024-07-11 17:01:16 +02:00
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
|
}
|
|
|
|
|
|
2024-07-11 18:29:22 +02:00
|
|
|
public function getDate(): ?\DateTimeImmutable
|
2024-07-11 17:01:16 +02:00
|
|
|
{
|
2024-07-11 18:29:22 +02:00
|
|
|
return $this->date;
|
2024-07-11 17:01:16 +02:00
|
|
|
}
|
|
|
|
|
|
2024-07-11 18:29:22 +02:00
|
|
|
public function setDate(\DateTimeImmutable $date): static
|
2024-07-11 17:01:16 +02:00
|
|
|
{
|
2024-07-11 18:29:22 +02:00
|
|
|
$this->date = $date;
|
2024-07-11 17:01:16 +02:00
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
|
}
|
|
|
|
|
|
2024-07-11 18:29:22 +02:00
|
|
|
public function getEntity(): ?Entity
|
2024-07-11 17:01:16 +02:00
|
|
|
{
|
2024-07-11 18:29:22 +02:00
|
|
|
return $this->entity;
|
2024-07-11 17:01:16 +02:00
|
|
|
}
|
|
|
|
|
|
2024-07-11 18:29:22 +02:00
|
|
|
public function setEntity(?Entity $entity): static
|
2024-07-11 17:01:16 +02:00
|
|
|
{
|
2024-07-11 18:29:22 +02:00
|
|
|
$this->entity = $entity;
|
2024-07-11 17:01:16 +02:00
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
|
}
|
2024-07-11 18:29:22 +02:00
|
|
|
|
2024-07-11 17:01:16 +02:00
|
|
|
}
|