feat: add entities

This commit is contained in:
Maël Gangloff
2024-07-10 23:30:59 +02:00
parent d0f8a220bd
commit cbaca7bf6a
12 changed files with 860 additions and 0 deletions

67
src/Entity/Event.php Normal file
View File

@@ -0,0 +1,67 @@
<?php
namespace App\Entity;
use App\Repository\EventRepository;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: EventRepository::class)]
class Event
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255)]
private ?string $action = null;
#[ORM\Column(type: Types::DATE_IMMUTABLE)]
private ?\DateTimeImmutable $date = null;
#[ORM\ManyToOne(inversedBy: 'events')]
#[ORM\JoinColumn(nullable: false)]
private ?Domain $domain = null;
public function getId(): ?int
{
return $this->id;
}
public function getAction(): ?string
{
return $this->action;
}
public function setAction(string $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;
}
public function getDomain(): ?Domain
{
return $this->domain;
}
public function setDomain(?Domain $domain): static
{
$this->domain = $domain;
return $this;
}
}