59 lines
1.1 KiB
PHP
Raw Normal View History

2024-07-11 17:01:16 +02:00
<?php
namespace App\Entity;
2024-07-17 00:19:27 +02:00
use ApiPlatform\Metadata\ApiResource;
use ApiPlatform\Metadata\Get;
2024-07-11 17:01:16 +02:00
use App\Config\EventAction;
2024-07-11 22:22:59 +02:00
use DateTimeImmutable;
2024-07-11 17:01:16 +02:00
use Doctrine\ORM\Mapping as ORM;
2024-07-17 00:19:27 +02:00
use Symfony\Component\Serializer\Attribute\Groups;
2024-07-11 17:01:16 +02:00
2024-07-11 22:20:20 +02:00
#[ORM\MappedSuperclass]
2024-07-11 18:29:22 +02:00
class Event
2024-07-11 17:01:16 +02:00
{
2024-07-11 18:29:22 +02:00
#[ORM\Id]
2024-07-12 13:16:40 +02:00
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
2024-07-11 18:29:22 +02:00
#[ORM\Column(enumType: EventAction::class)]
2024-07-17 00:19:27 +02:00
#[Groups(['event:list'])]
2024-07-11 18:29:22 +02:00
private ?EventAction $action = null;
2024-07-12 01:49:46 +02:00
#[ORM\Column(type: 'datetime_immutable')]
2024-07-17 00:19:27 +02:00
#[Groups(['event:list'])]
2024-07-11 22:22:59 +02:00
private ?DateTimeImmutable $date = null;
2024-07-11 17:01:16 +02:00
2024-07-12 13:16:40 +02:00
public function getId(): ?int
{
return $this->id;
}
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 22:22:59 +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 22:22:59 +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;
}
}