<?php
namespace App\Entity\Training;
use ApiPlatform\Core\Annotation\ApiResource;
use App\Repository\Training\AbsenceRepository;
use App\Traits\Actions;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: AbsenceRepository::class)]
#[ORM\Table(name: 'hs_tc_training_absence')]
#[ApiResource]
class Absence
{
use Actions;
#[ORM\ManyToOne(inversedBy: 'absences')]
#[ORM\JoinColumn(nullable: false)]
private ?Seance $seance = null;
#[ORM\ManyToOne(inversedBy: 'absences')]
#[ORM\JoinColumn(nullable: false)]
private ?Trainee $trainee = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $reason = null;
public function __construct()
{
// date_default_timezone_set('Africa/Casablanca');
$this->createAt=new \DateTime('now');
$this->published=false;
}
public function getSeance(): ?Seance
{
return $this->seance;
}
public function setSeance(?Seance $seance): self
{
$this->seance = $seance;
return $this;
}
public function getTrainee(): ?Trainee
{
return $this->trainee;
}
public function setTrainee(?Trainee $trainee): self
{
$this->trainee = $trainee;
return $this;
}
public function getReason(): ?string
{
return $this->reason;
}
public function setReason(?string $reason): self
{
$this->reason = $reason;
return $this;
}
}