src/Entity/PeriodeCle.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\PeriodeCleRepository;
  4. use DateTimeInterface;
  5. use Doctrine\DBAL\Types\Types;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassPeriodeCleRepository::class)]
  8. class PeriodeCle
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column]
  13.     private ?int $id null;
  14.     #[ORM\Column(typeTypes::DATE_MUTABLE)]
  15.     private ?DateTimeInterface $debut null;
  16.     #[ORM\Column(typeTypes::DATE_MUTABLE)]
  17.     private ?DateTimeInterface $fin null;
  18.     #[ORM\ManyToOne]
  19.     #[ORM\JoinColumn(nullablefalse)]
  20.     private ?PeriodeType $refPeriodeType null;
  21.     public function getId(): ?int
  22.     {
  23.         return $this->id;
  24.     }
  25.     public function getDebut(): ?DateTimeInterface
  26.     {
  27.         return $this->debut;
  28.     }
  29.     public function setDebut(DateTimeInterface $debut): self
  30.     {
  31.         $this->debut $debut;
  32.         return $this;
  33.     }
  34.     public function getFin(): ?DateTimeInterface
  35.     {
  36.         return $this->fin;
  37.     }
  38.     public function setFin(DateTimeInterface $fin): self
  39.     {
  40.         $this->fin $fin;
  41.         return $this;
  42.     }
  43.     public function getRefPeriodeType(): ?PeriodeType
  44.     {
  45.         return $this->refPeriodeType;
  46.     }
  47.     public function setRefPeriodeType(?PeriodeType $refPeriodeType): self
  48.     {
  49.         $this->refPeriodeType $refPeriodeType;
  50.         return $this;
  51.     }
  52.     public function __toString(): string
  53.     {
  54.         return $this->refPeriodeType." (".date_format($this->debut,"d/m/Y")." / ".date_format($this->fin,"d/m/Y").")";
  55.         // TODO: Implement __toString() method.
  56.     }
  57. }