<?phpnamespace App\Entity;use App\Repository\ModuleRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;use Symfony\Component\Validator\Constraints as Assert;#[ORM\Entity(repositoryClass: ModuleRepository::class)]class Module{ #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column] private ?int $id = null; #[ORM\Column(length: 255, nullable: true)] #[Assert\NotBlank (message:"Le champ ne peut pas ĂȘtre vide.")] private ?string $libele = null; #[ORM\OneToMany(mappedBy: 'module', targetEntity: Engagement::class)] private Collection $engagements; #[ORM\Column(nullable: true)] private ?int $nombreHeure = null; #[ORM\Column(nullable: true)] private ?float $prixHeure = null; #[ORM\Column(nullable: true)] private ?float $coefficient = null; #[ORM\OneToMany(mappedBy: 'module', targetEntity: InscriptionModule::class)] private Collection $inscriptionModules; public function __construct() { $this->engagements = new ArrayCollection(); $this->inscriptionModules = new ArrayCollection(); } public function __toString() { return $this->libele; } public function getId(): ?int { return $this->id; } public function getLibele(): ?string { return $this->libele; } public function setLibele(?string $libele): self { $this->libele = $libele; return $this; } /** * @return Collection<int, Engagement> */ public function getEngagements(): Collection { return $this->engagements; } public function addEngagement(Engagement $engagement): self { if (!$this->engagements->contains($engagement)) { $this->engagements->add($engagement); $engagement->setModule($this); } return $this; } public function removeEngagement(Engagement $engagement): self { if ($this->engagements->removeElement($engagement)) { // set the owning side to null (unless already changed) if ($engagement->getModule() === $this) { $engagement->setModule(null); } } return $this; } public function getNombreHeure(): ?int { return $this->nombreHeure; } public function setNombreHeure(?int $nombreHeure): self { $this->nombreHeure = $nombreHeure; return $this; } public function getPrixHeure(): ?float { return $this->prixHeure; } public function setPrixHeure(?float $prixHeure): self { $this->prixHeure = $prixHeure; return $this; } public function getCoefficient(): ?float { return $this->coefficient; } public function setCoefficient(?float $coefficient): self { $this->coefficient = $coefficient; return $this; } /** * @return Collection<int, InscriptionModule> */ public function getInscriptionModules(): Collection { return $this->inscriptionModules; } public function addInscriptionModule( InscriptionModule $inscriptionModule ): self { if (!$this->inscriptionModules->contains($inscriptionModule)) { $this->inscriptionModules->add($inscriptionModule); $inscriptionModule->setModule($this); } return $this; } public function removeInscriptionModule( InscriptionModule $inscriptionModule ): self { if ($this->inscriptionModules->removeElement($inscriptionModule)) { // set the owning side to null (unless already changed) if ($inscriptionModule->getModule() === $this) { $inscriptionModule->setModule(null); } } return $this; }}