2024-07-10 23:30:59 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Entity;
|
|
|
|
|
|
2024-07-11 17:01:16 +02:00
|
|
|
use App\Config\EventAction;
|
|
|
|
|
use App\Repository\DomainEventRepository;
|
2024-07-10 23:30:59 +02:00
|
|
|
use Doctrine\DBAL\Types\Types;
|
|
|
|
|
use Doctrine\ORM\Mapping as ORM;
|
|
|
|
|
|
2024-07-11 17:01:16 +02:00
|
|
|
#[ORM\Entity(repositoryClass: DomainEventRepository::class)]
|
|
|
|
|
class DomainEvent
|
2024-07-10 23:30:59 +02:00
|
|
|
{
|
|
|
|
|
#[ORM\Id]
|
2024-07-11 17:01:16 +02:00
|
|
|
#[ORM\Column(enumType: EventAction::class)]
|
|
|
|
|
private ?EventAction $action = null;
|
2024-07-10 23:30:59 +02:00
|
|
|
|
|
|
|
|
#[ORM\Column(type: Types::DATE_IMMUTABLE)]
|
|
|
|
|
private ?\DateTimeImmutable $date = null;
|
|
|
|
|
|
2024-07-10 23:58:59 +02:00
|
|
|
#[ORM\Id]
|
2024-07-11 17:01:16 +02:00
|
|
|
#[ORM\ManyToOne(targetEntity: Domain::class, inversedBy: 'events')]
|
|
|
|
|
#[ORM\JoinColumn(referencedColumnName: 'handle', nullable: false)]
|
2024-07-10 23:30:59 +02:00
|
|
|
private ?Domain $domain = null;
|
|
|
|
|
|
2024-07-11 17:01:16 +02:00
|
|
|
public function getAction(): ?EventAction
|
2024-07-10 23:30:59 +02:00
|
|
|
{
|
|
|
|
|
return $this->action;
|
|
|
|
|
}
|
|
|
|
|
|
2024-07-11 17:01:16 +02:00
|
|
|
public function setAction(EventAction $action): static
|
2024-07-10 23:30:59 +02:00
|
|
|
{
|
|
|
|
|
$this->action = $action;
|
|
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function getDate(): ?\DateTimeImmutable
|
|
|
|
|
{
|
|
|
|
|
return $this->date;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function setDate(\DateTimeImmutable $date): static
|
|
|
|
|
{
|
|
|
|
|
$this->date = $date;
|
|
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function getDomain(): ?Domain
|
|
|
|
|
{
|
|
|
|
|
return $this->domain;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function setDomain(?Domain $domain): static
|
|
|
|
|
{
|
|
|
|
|
$this->domain = $domain;
|
|
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
|
}
|
|
|
|
|
}
|