src/Entity/Module.php line 12

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. use Symfony\Component\Validator\Constraints as Assert;
  8. #[ORM\Entity(repositoryClassModuleRepository::class)]
  9. class Module
  10. {
  11.     #[ORM\Id]
  12.     #[ORM\GeneratedValue]
  13.     #[ORM\Column]
  14.     private ?int $id null;
  15.     #[ORM\Column(length255nullabletrue)]
  16.     #[Assert\NotBlank (message:"Le champ ne peut pas ĂȘtre vide.")]
  17.     private ?string $libele null;
  18.     #[ORM\OneToMany(mappedBy'module'targetEntityEngagement::class)]
  19.     private Collection $engagements;
  20.     #[ORM\Column(nullabletrue)]
  21.     private ?int $nombreHeure null;
  22.     #[ORM\Column(nullabletrue)]
  23.     private ?float $prixHeure null;
  24.     #[ORM\Column(nullabletrue)]
  25.     private ?float $coefficient null;
  26.     #[ORM\OneToMany(mappedBy'module'targetEntityInscriptionModule::class)]
  27.     private Collection $inscriptionModules;
  28.     public function __construct()
  29.     {
  30.         $this->engagements = new ArrayCollection();
  31.         $this->inscriptionModules = new ArrayCollection();
  32.     }
  33.     public function __toString()
  34.     {
  35.         return $this->libele;
  36.     }
  37.     public function getId(): ?int
  38.     {
  39.         return $this->id;
  40.     }
  41.     public function getLibele(): ?string
  42.     {
  43.         return $this->libele;
  44.     }
  45.     public function setLibele(?string $libele): self
  46.     {
  47.         $this->libele $libele;
  48.         return $this;
  49.     }
  50.     /**
  51.      * @return Collection<int, Engagement>
  52.      */
  53.     public function getEngagements(): Collection
  54.     {
  55.         return $this->engagements;
  56.     }
  57.     public function addEngagement(Engagement $engagement): self
  58.     {
  59.         if (!$this->engagements->contains($engagement)) {
  60.             $this->engagements->add($engagement);
  61.             $engagement->setModule($this);
  62.         }
  63.         return $this;
  64.     }
  65.     public function removeEngagement(Engagement $engagement): self
  66.     {
  67.         if ($this->engagements->removeElement($engagement)) {
  68.             // set the owning side to null (unless already changed)
  69.             if ($engagement->getModule() === $this) {
  70.                 $engagement->setModule(null);
  71.             }
  72.         }
  73.         return $this;
  74.     }
  75.     public function getNombreHeure(): ?int
  76.     {
  77.         return $this->nombreHeure;
  78.     }
  79.     public function setNombreHeure(?int $nombreHeure): self
  80.     {
  81.         $this->nombreHeure $nombreHeure;
  82.         return $this;
  83.     }
  84.     public function getPrixHeure(): ?float
  85.     {
  86.         return $this->prixHeure;
  87.     }
  88.     public function setPrixHeure(?float $prixHeure): self
  89.     {
  90.         $this->prixHeure $prixHeure;
  91.         return $this;
  92.     }
  93.     public function getCoefficient(): ?float
  94.     {
  95.         return $this->coefficient;
  96.     }
  97.     public function setCoefficient(?float $coefficient): self
  98.     {
  99.         $this->coefficient $coefficient;
  100.         return $this;
  101.     }
  102.     /**
  103.      * @return Collection<int, InscriptionModule>
  104.      */
  105.     public function getInscriptionModules(): Collection
  106.     {
  107.         return $this->inscriptionModules;
  108.     }
  109.     public function addInscriptionModule(
  110.         InscriptionModule $inscriptionModule
  111.     ): self {
  112.         if (!$this->inscriptionModules->contains($inscriptionModule)) {
  113.             $this->inscriptionModules->add($inscriptionModule);
  114.             $inscriptionModule->setModule($this);
  115.         }
  116.         return $this;
  117.     }
  118.     public function removeInscriptionModule(
  119.         InscriptionModule $inscriptionModule
  120.     ): self {
  121.         if ($this->inscriptionModules->removeElement($inscriptionModule)) {
  122.             // set the owning side to null (unless already changed)
  123.             if ($inscriptionModule->getModule() === $this) {
  124.                 $inscriptionModule->setModule(null);
  125.             }
  126.         }
  127.         return $this;
  128.     }
  129. }