src/Entity/Module.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ModuleRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassModuleRepository::class)]
  8. class Module
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column]
  13.     private ?int $id null;
  14.     #[ORM\Column(length255)]
  15.     private ?string $label null;
  16.     #[ORM\Column(length2048nullabletrue)]
  17.     private ?string $description null;
  18.     #[ORM\Column]
  19.     private ?bool $isShowable null;
  20.     #[ORM\ManyToOne(inversedBy'modules')]
  21.     #[ORM\JoinColumn(nullablefalse)]
  22.     private ?Prestation $prestation null;
  23.     #[ORM\OneToMany(mappedBy'module'targetEntityDemandeService::class)]
  24.     private Collection $demandeServices;
  25.     #[ORM\ManyToMany(targetEntityQuiz::class, mappedBy'module')]
  26.     private Collection $quizzes;
  27.     #[ORM\OneToMany(mappedBy'module'targetEntityFicheEval::class)]
  28.     private Collection $ficheEvals;
  29.     #[ORM\Column(length255nullabletrue)]
  30.     private ?string $file null;
  31.     public function __construct()
  32.     {
  33.         $this->demandeServices = new ArrayCollection();
  34.         $this->quizzes = new ArrayCollection();
  35.         $this->ficheEvals = new ArrayCollection();
  36.     }
  37.     public function getId(): ?int
  38.     {
  39.         return $this->id;
  40.     }
  41.     public function getLabel(): ?string
  42.     {
  43.         return $this->label;
  44.     }
  45.     public function setLabel(string $label): self
  46.     {
  47.         $this->label $label;
  48.         return $this;
  49.     }
  50.     public function getDescription(): ?string
  51.     {
  52.         return $this->description;
  53.     }
  54.     public function setDescription(?string $description): self
  55.     {
  56.         $this->description $description;
  57.         return $this;
  58.     }
  59.     public function getPrestation(): ?Prestation
  60.     {
  61.         return $this->prestation;
  62.     }
  63.     public function setPrestation(?Prestation $prestation): self
  64.     {
  65.         $this->prestation $prestation;
  66.         return $this;
  67.     }
  68.     public function isIsShowable(): ?bool
  69.     {
  70.         return $this->isShowable;
  71.     }
  72.     public function setIsShowable(bool $isShowable): self
  73.     {
  74.         $this->isShowable $isShowable;
  75.         return $this;
  76.     }
  77.     public function __toString()
  78.     {
  79.         return $this->label;
  80.     }
  81.     /**
  82.      * @return Collection<int, DemandeService>
  83.      */
  84.     public function getDemandeServices(): Collection
  85.     {
  86.         return $this->demandeServices;
  87.     }
  88.     public function addDemandeService(DemandeService $demandeService): self
  89.     {
  90.         if (!$this->demandeServices->contains($demandeService)) {
  91.             $this->demandeServices->add($demandeService);
  92.             $demandeService->setModule($this);
  93.         }
  94.         return $this;
  95.     }
  96.     public function removeDemandeService(DemandeService $demandeService): self
  97.     {
  98.         if ($this->demandeServices->removeElement($demandeService)) {
  99.             // set the owning side to null (unless already changed)
  100.             if ($demandeService->getModule() === $this) {
  101.                 $demandeService->setModule(null);
  102.             }
  103.         }
  104.         return $this;
  105.     }
  106.     /**
  107.      * @return Collection<int, Quiz>
  108.      */
  109.     public function getQuizzes(): Collection
  110.     {
  111.         return $this->quizzes;
  112.     }
  113.     public function addQuiz(Quiz $quiz): self
  114.     {
  115.         if (!$this->quizzes->contains($quiz)) {
  116.             $this->quizzes->add($quiz);
  117.             $quiz->addModule($this);
  118.         }
  119.         return $this;
  120.     }
  121.     public function removeQuiz(Quiz $quiz): self
  122.     {
  123.         if ($this->quizzes->removeElement($quiz)) {
  124.             $quiz->removeModule($this);
  125.         }
  126.         return $this;
  127.     }
  128.     /**
  129.      * @return Collection<int, FicheEval>
  130.      */
  131.     public function getFicheEvals(): Collection
  132.     {
  133.         return $this->ficheEvals;
  134.     }
  135.     public function addFicheEval(FicheEval $ficheEval): self
  136.     {
  137.         if (!$this->ficheEvals->contains($ficheEval)) {
  138.             $this->ficheEvals->add($ficheEval);
  139.             $ficheEval->setModule($this);
  140.         }
  141.         return $this;
  142.     }
  143.     public function removeFicheEval(FicheEval $ficheEval): self
  144.     {
  145.         if ($this->ficheEvals->removeElement($ficheEval)) {
  146.             // set the owning side to null (unless already changed)
  147.             if ($ficheEval->getModule() === $this) {
  148.                 $ficheEval->setModule(null);
  149.             }
  150.         }
  151.         return $this;
  152.     }
  153.     public function getFile(): ?string
  154.     {
  155.         return $this->file;
  156.     }
  157.     public function setFile(?string $file): self
  158.     {
  159.         $this->file $file;
  160.         return $this;
  161.     }
  162. }