<?phpnamespace App\Entity;use App\Repository\ModuleRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: ModuleRepository::class)]class Module{ #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column] private ?int $id = null; #[ORM\Column(length: 255)] private ?string $label = null; #[ORM\Column(length: 2048, nullable: true)] private ?string $description = null; #[ORM\Column] private ?bool $isShowable = null; #[ORM\ManyToOne(inversedBy: 'modules')] #[ORM\JoinColumn(nullable: false)] private ?Prestation $prestation = null; #[ORM\OneToMany(mappedBy: 'module', targetEntity: DemandeService::class)] private Collection $demandeServices; #[ORM\ManyToMany(targetEntity: Quiz::class, mappedBy: 'module')] private Collection $quizzes; #[ORM\OneToMany(mappedBy: 'module', targetEntity: FicheEval::class)] private Collection $ficheEvals; #[ORM\Column(length: 255, nullable: true)] private ?string $file = null; public function __construct() { $this->demandeServices = new ArrayCollection(); $this->quizzes = new ArrayCollection(); $this->ficheEvals = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getLabel(): ?string { return $this->label; } public function setLabel(string $label): self { $this->label = $label; return $this; } public function getDescription(): ?string { return $this->description; } public function setDescription(?string $description): self { $this->description = $description; return $this; } public function getPrestation(): ?Prestation { return $this->prestation; } public function setPrestation(?Prestation $prestation): self { $this->prestation = $prestation; return $this; } public function isIsShowable(): ?bool { return $this->isShowable; } public function setIsShowable(bool $isShowable): self { $this->isShowable = $isShowable; return $this; } public function __toString() { return $this->label; } /** * @return Collection<int, DemandeService> */ public function getDemandeServices(): Collection { return $this->demandeServices; } public function addDemandeService(DemandeService $demandeService): self { if (!$this->demandeServices->contains($demandeService)) { $this->demandeServices->add($demandeService); $demandeService->setModule($this); } return $this; } public function removeDemandeService(DemandeService $demandeService): self { if ($this->demandeServices->removeElement($demandeService)) { // set the owning side to null (unless already changed) if ($demandeService->getModule() === $this) { $demandeService->setModule(null); } } return $this; } /** * @return Collection<int, Quiz> */ public function getQuizzes(): Collection { return $this->quizzes; } public function addQuiz(Quiz $quiz): self { if (!$this->quizzes->contains($quiz)) { $this->quizzes->add($quiz); $quiz->addModule($this); } return $this; } public function removeQuiz(Quiz $quiz): self { if ($this->quizzes->removeElement($quiz)) { $quiz->removeModule($this); } return $this; } /** * @return Collection<int, FicheEval> */ public function getFicheEvals(): Collection { return $this->ficheEvals; } public function addFicheEval(FicheEval $ficheEval): self { if (!$this->ficheEvals->contains($ficheEval)) { $this->ficheEvals->add($ficheEval); $ficheEval->setModule($this); } return $this; } public function removeFicheEval(FicheEval $ficheEval): self { if ($this->ficheEvals->removeElement($ficheEval)) { // set the owning side to null (unless already changed) if ($ficheEval->getModule() === $this) { $ficheEval->setModule(null); } } return $this; } public function getFile(): ?string { return $this->file; } public function setFile(?string $file): self { $this->file = $file; return $this; }}