mirror of
https://github.com/maelgangloff/domain-watchdog.git
synced 2025-12-17 17:55:42 +00:00
59 lines
1.1 KiB
PHP
59 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace App\Entity;
|
|
|
|
use ApiPlatform\Metadata\ApiResource;
|
|
use ApiPlatform\Metadata\Get;
|
|
use App\Config\EventAction;
|
|
use DateTimeImmutable;
|
|
use Doctrine\ORM\Mapping as ORM;
|
|
use Symfony\Component\Serializer\Attribute\Groups;
|
|
|
|
#[ORM\MappedSuperclass]
|
|
class Event
|
|
{
|
|
#[ORM\Id]
|
|
#[ORM\GeneratedValue]
|
|
#[ORM\Column]
|
|
private ?int $id = null;
|
|
|
|
#[ORM\Column(enumType: EventAction::class)]
|
|
#[Groups(['event:list'])]
|
|
private ?EventAction $action = null;
|
|
|
|
#[ORM\Column(type: 'datetime_immutable')]
|
|
#[Groups(['event:list'])]
|
|
private ?DateTimeImmutable $date = null;
|
|
|
|
|
|
public function getId(): ?int
|
|
{
|
|
return $this->id;
|
|
}
|
|
|
|
public function getAction(): ?EventAction
|
|
{
|
|
return $this->action;
|
|
}
|
|
|
|
public function setAction(EventAction $action): static
|
|
{
|
|
$this->action = $action;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function getDate(): ?DateTimeImmutable
|
|
{
|
|
return $this->date;
|
|
}
|
|
|
|
public function setDate(DateTimeImmutable $date): static
|
|
{
|
|
$this->date = $date;
|
|
|
|
return $this;
|
|
}
|
|
|
|
}
|