src/Entity/Gestiform/Formations/Session/Planning/ApprenantLivrable.php line 17

  1. <?php
  2. namespace App\Entity\Gestiform\Formations\Session\Planning;
  3. use App\Entity\AbstractEntity;
  4. use App\Entity\Common\Upload;
  5. use App\Entity\Gestiform\Admin\MasterListe\Masterlistelg;
  6. use App\Entity\Gestiform\Users\Formateur;
  7. use App\Repository\Gestiform\Formations\Session\Planning\ApprenantLivrableRepository;
  8. use Doctrine\Common\Collections\ArrayCollection;
  9. use Doctrine\Common\Collections\Collection;
  10. use Doctrine\ORM\Mapping as ORM;
  11. #[ORM\Entity(repositoryClassApprenantLivrableRepository::class)]
  12. class ApprenantLivrable extends AbstractEntity
  13. {
  14.     #[ORM\JoinColumn(nullabletrue)]
  15.     #[ORM\ManyToOne(targetEntityFormateur::class, inversedBy'apprenantLivrables')]
  16.     private ?Formateur $formateur null;
  17.     #[ORM\OneToOne(inversedBy'apprenantLivrable'targetEntityPlanningEvent::class)]
  18.     private ?PlanningEvent $planningEvent null;
  19.     #[ORM\JoinColumn(nullabletrue)]
  20.     #[ORM\ManyToOne(targetEntityMasterlistelg::class)]
  21.     private ?Masterlistelg $categorie null;
  22.     #[ORM\JoinColumn(nullabletrue)]
  23.     #[ORM\ManyToOne(targetEntityMasterlistelg::class)]
  24.     private ?Masterlistelg $type null;
  25.     #[ORM\ManyToMany(targetEntityUpload::class, cascade: ['all'])]
  26.     private Collection $files;
  27.     #[ORM\Column(type'boolean'nullabletrue)]
  28.     private ?bool $approuver false;
  29.     #[ORM\Column(type'integer'nullabletrue)]
  30.     private ?int $note null;
  31.     #[ORM\Column(type'string'length255nullabletrue)]
  32.     private ?string $commentaire null;
  33.     public function __construct()
  34.     {
  35.         $this->files = new ArrayCollection();
  36.     }
  37.     public function getNote(): ?int
  38.     {
  39.         return $this->note;
  40.     }
  41.     public function setNote(?int $note): static
  42.     {
  43.         $this->note $note;
  44.         return $this;
  45.     }
  46.     public function getCommentaire(): ?string
  47.     {
  48.         return $this->commentaire;
  49.     }
  50.     public function setCommentaire(?string $commentaire): self
  51.     {
  52.         $this->commentaire $commentaire;
  53.         return $this;
  54.     }
  55.     public function getFormateur(): ?Formateur
  56.     {
  57.         return $this->formateur;
  58.     }
  59.     public function setFormateur(?Formateur $formateur): self
  60.     {
  61.         $this->formateur $formateur;
  62.         return $this;
  63.     }
  64.     public function getPlanningEvent(): ?PlanningEvent
  65.     {
  66.         return $this->planningEvent;
  67.     }
  68.     public function setPlanningEvent(?PlanningEvent $planningEvent): self
  69.     {
  70.         $this->planningEvent $planningEvent;
  71.         return $this;
  72.     }
  73.     public function getCategorie(): ?Masterlistelg
  74.     {
  75.         return $this->categorie;
  76.     }
  77.     public function setCategorie(?Masterlistelg $categorie): self
  78.     {
  79.         $this->categorie $categorie;
  80.         return $this;
  81.     }
  82.     public function getType(): ?Masterlistelg
  83.     {
  84.         return $this->type;
  85.     }
  86.     public function setType(?Masterlistelg $type): self
  87.     {
  88.         $this->type $type;
  89.         return $this;
  90.     }
  91.     /**
  92.      * @return Collection<int, Upload>
  93.      */
  94.     public function getFiles(): Collection
  95.     {
  96.         return $this->files;
  97.     }
  98.     public function addFile(Upload $file): self
  99.     {
  100.         if (!$this->files->contains($file)) {
  101.             $this->files->add($file);
  102.         }
  103.         return $this;
  104.     }
  105.     public function removeFile(Upload $file): self
  106.     {
  107.         $this->files->removeElement($file);
  108.         return $this;
  109.     }
  110.     public function getApprouver(): ?bool
  111.     {
  112.         return $this->approuver;
  113.     }
  114.     public function setApprouver(?bool $approuver): self
  115.     {
  116.         $this->approuver $approuver;
  117.         return $this;
  118.     }
  119. }