<?php
namespace App\Entity;
use App\Repository\PeriodeCleRepository;
use DateTimeInterface;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: PeriodeCleRepository::class)]
class PeriodeCle
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(type: Types::DATE_MUTABLE)]
private ?DateTimeInterface $debut = null;
#[ORM\Column(type: Types::DATE_MUTABLE)]
private ?DateTimeInterface $fin = null;
#[ORM\ManyToOne]
#[ORM\JoinColumn(nullable: false)]
private ?PeriodeType $refPeriodeType = null;
public function getId(): ?int
{
return $this->id;
}
public function getDebut(): ?DateTimeInterface
{
return $this->debut;
}
public function setDebut(DateTimeInterface $debut): self
{
$this->debut = $debut;
return $this;
}
public function getFin(): ?DateTimeInterface
{
return $this->fin;
}
public function setFin(DateTimeInterface $fin): self
{
$this->fin = $fin;
return $this;
}
public function getRefPeriodeType(): ?PeriodeType
{
return $this->refPeriodeType;
}
public function setRefPeriodeType(?PeriodeType $refPeriodeType): self
{
$this->refPeriodeType = $refPeriodeType;
return $this;
}
public function __toString(): string
{
return $this->refPeriodeType." (".date_format($this->debut,"d/m/Y")." / ".date_format($this->fin,"d/m/Y").")";
// TODO: Implement __toString() method.
}
}