src\Entity\ProgrammeFormation.php line 8

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. #[ORM\Entity(repositoryClass\App\Repository\ProgrammeFormationRepository::class)]
  5. class ProgrammeFormation
  6. {
  7.     #[ORM\Id]
  8.     #[ORM\GeneratedValue]
  9.     #[ORM\Column(type'integer')]
  10.     private $id;
  11.     #[ORM\Column(type'integer')]
  12.     private $type;
  13.     #[ORM\Column(type'datetime'nullabletrue)]
  14.     private $date_debut;
  15.     #[ORM\Column(type'datetime'nullabletrue)]
  16.     private $date_fin;
  17.     #[ORM\Column(type'boolean')]
  18.     private $status;
  19.     #[ORM\Column(type'string'length255nullabletrue)]
  20.     private $lieu;
  21.     const type_long=['Physique','Virtuelle'];
  22.     public function getFullType()
  23.     {
  24.         return self::type_long[$this->type];
  25.     }
  26.     #[ORM\JoinColumn(nullablefalse)]
  27.     #[ORM\ManyToOne(targetEntity\App\Entity\Formation::class, inversedBy'programmes')]
  28.     private $formation;
  29.     #[ORM\Column(type'text'nullabletrue)]
  30.     private $description;
  31.     #[ORM\Column(type'datetime')]
  32.     private $created_at;
  33.     public function __construct()
  34.     {
  35.         $this->status=false;
  36.         $this->created_at=new \DateTime();
  37.     }
  38.     public function getId(): ?int
  39.     {
  40.         return $this->id;
  41.     }
  42.     public function getType(): ?int
  43.     {
  44.         return $this->type;
  45.     }
  46.     public function setType(int $type): self
  47.     {
  48.         $this->type $type;
  49.         return $this;
  50.     }
  51.     public function getDateDebut(): ?\DateTimeInterface
  52.     {
  53.         return $this->date_debut;
  54.     }
  55.     public function setDateDebut(?\DateTimeInterface $date_debut): self
  56.     {
  57.         $this->date_debut $date_debut;
  58.         return $this;
  59.     }
  60.     public function getDateFin(): ?\DateTimeInterface
  61.     {
  62.         return $this->date_fin;
  63.     }
  64.     public function setDateFin(?\DateTimeInterface $date_fin): self
  65.     {
  66.         $this->date_fin $date_fin;
  67.         return $this;
  68.     }
  69.     public function getStatus(): ?bool
  70.     {
  71.         return $this->status;
  72.     }
  73.     public function setStatus(bool $status): self
  74.     {
  75.         $this->status $status;
  76.         return $this;
  77.     }
  78.     public function getLieu(): ?string
  79.     {
  80.         return $this->lieu;
  81.     }
  82.     public function setLieu(?string $lieu): self
  83.     {
  84.         $this->lieu $lieu;
  85.         return $this;
  86.     }
  87.     public function getFormation(): ?Formation
  88.     {
  89.         return $this->formation;
  90.     }
  91.     public function setFormation(?Formation $formation): self
  92.     {
  93.         $this->formation $formation;
  94.         return $this;
  95.     }
  96.     public function getDescription(): ?string
  97.     {
  98.         return $this->description;
  99.     }
  100.     public function setDescription(?string $description): self
  101.     {
  102.         $this->description $description;
  103.         return $this;
  104.     }
  105.     public function getCreatedAt(): ?\DateTimeInterface
  106.     {
  107.         return $this->created_at;
  108.     }
  109.     public function setCreatedAt(\DateTimeInterface $created_at): self
  110.     {
  111.         $this->created_at $created_at;
  112.         return $this;
  113.     }
  114. }