src/Entity/Prestation.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\PrestationRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassPrestationRepository::class)]
  8. class Prestation
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column(type'integer')]
  13.     private $id;
  14.     #[ORM\Column(type'string'length255)]
  15.     private $libelle;
  16.     #[ORM\ManyToOne(inversedBy'prestations')]
  17.     #[ORM\JoinColumn(nullablefalse)]
  18.     private ?Rubrique $rubrique null;
  19.     #[ORM\OneToMany(mappedBy'prestation'targetEntityModule::class, orphanRemovaltruecascade: ['persist''remove'])]
  20.     private Collection $modules;
  21.     #[ORM\OneToMany(mappedBy'prestation'targetEntityDemandeService::class)]
  22.     private Collection $demandeServices;
  23.     #[ORM\OneToMany(mappedBy'cycle'targetEntityGroupeDemande::class, orphanRemovaltrue)]
  24.     private Collection $groupeDemandes;
  25.     public function __construct()
  26.     {
  27.         $this->modules = new ArrayCollection();
  28.         $this->demandeServices = new ArrayCollection();
  29.         $this->groupeDemandes = new ArrayCollection();
  30.     }
  31.     public function __toString()
  32.     {
  33.         return $this->libelle;
  34.     }
  35.     public function getId(): ?int
  36.     {
  37.         return $this->id;
  38.     }
  39.     public function getLibelle(): ?string
  40.     {
  41.         return $this->libelle;
  42.     }
  43.     public function setLibelle(string $libelle): self
  44.     {
  45.         $this->libelle $libelle;
  46.         return $this;
  47.     }
  48.     public function getRubrique(): ?Rubrique
  49.     {
  50.         return $this->rubrique;
  51.     }
  52.     public function setRubrique(?Rubrique $rubrique): self
  53.     {
  54.         $this->rubrique $rubrique;
  55.         return $this;
  56.     }
  57.     /**
  58.      * @return Collection<int, Module>
  59.      */
  60.     public function getModules(): Collection
  61.     {
  62.         return $this->modules;
  63.     }
  64.     public function addModule(Module $module): self
  65.     {
  66.         if (!$this->modules->contains($module)) {
  67.             $this->modules->add($module);
  68.             $module->setPrestation($this);
  69.         }
  70.         return $this;
  71.     }
  72.     public function removeModule(Module $module): self
  73.     {
  74.         if ($this->modules->removeElement($module)) {
  75.             // set the owning side to null (unless already changed)
  76.             if ($module->getPrestation() === $this) {
  77.                 $module->setPrestation(null);
  78.             }
  79.         }
  80.         return $this;
  81.     }
  82.     /**
  83.      * @return Collection<int, DemandeService>
  84.      */
  85.     public function getDemandeServices(): Collection
  86.     {
  87.         return $this->demandeServices;
  88.     }
  89.     public function addDemandeService(DemandeService $demandeService): self
  90.     {
  91.         if (!$this->demandeServices->contains($demandeService)) {
  92.             $this->demandeServices->add($demandeService);
  93.             $demandeService->setPrestation($this);
  94.         }
  95.         return $this;
  96.     }
  97.     public function removeDemandeService(DemandeService $demandeService): self
  98.     {
  99.         if ($this->demandeServices->removeElement($demandeService)) {
  100.             // set the owning side to null (unless already changed)
  101.             if ($demandeService->getPrestation() === $this) {
  102.                 $demandeService->setPrestation(null);
  103.             }
  104.         }
  105.         return $this;
  106.     }
  107.     /**
  108.      * @return Collection<int, GroupeDemande>
  109.      */
  110.     public function getGroupeDemandes(): Collection
  111.     {
  112.         return $this->groupeDemandes;
  113.     }
  114.     public function addGroupeDemande(GroupeDemande $groupeDemande): self
  115.     {
  116.         if (!$this->groupeDemandes->contains($groupeDemande)) {
  117.             $this->groupeDemandes->add($groupeDemande);
  118.             $groupeDemande->setCycle($this);
  119.         }
  120.         return $this;
  121.     }
  122.     public function removeGroupeDemande(GroupeDemande $groupeDemande): self
  123.     {
  124.         if ($this->groupeDemandes->removeElement($groupeDemande)) {
  125.             // set the owning side to null (unless already changed)
  126.             if ($groupeDemande->getCycle() === $this) {
  127.                 $groupeDemande->setCycle(null);
  128.             }
  129.         }
  130.         return $this;
  131.     }
  132. }