Files
myep-team/src/Entity/TrainingAttendance.php
T

100 lines
2.1 KiB
PHP

<?php
namespace App\Entity;
use App\Entity\Traits\TimestampableEntity;
use App\Repository\TrainingAttendanceRepository;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Uid\Uuid;
#[ORM\Entity(repositoryClass: TrainingAttendanceRepository::class)]
class TrainingAttendance implements TimestampableEntityInterface
{
use TimestampableEntity;
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(type: 'string', length: 36, unique: true)]
private string $uuid;
#[ORM\ManyToOne(inversedBy: 'trainingAttendances')]
private ?Training $training = null;
#[ORM\Column(type: Types::DATE_IMMUTABLE)]
private ?\DateTimeImmutable $date;
#[ORM\OneToOne(cascade: ['persist', 'remove'])]
private ?Upload $certificate = null;
#[ORM\ManyToOne(inversedBy: 'trainingAttendances')]
private ?Teamer $teamer = null;
public function __construct()
{
$this->uuid = Uuid::v4();
$this->date = new \DateTimeImmutable();
}
public function getId(): ?int
{
return $this->id;
}
public function getUuid(): string
{
return $this->uuid;
}
public function getTraining(): ?Training
{
return $this->training;
}
public function setTraining(?Training $training): static
{
$this->training = $training;
return $this;
}
public function getDate(): ?\DateTimeImmutable
{
return $this->date;
}
public function setDate(\DateTimeImmutable $date): static
{
$this->date = $date;
return $this;
}
public function getCertificate(): ?Upload
{
return $this->certificate;
}
public function setCertificate(?Upload $certificate): static
{
$this->certificate = $certificate;
return $this;
}
public function getTeamer(): ?Teamer
{
return $this->teamer;
}
public function setTeamer(?Teamer $teamer): static
{
$this->teamer = $teamer;
return $this;
}
}