src/Entity/Promotion.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\PromotionRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=PromotionRepository::class)
  9.  */
  10. class Promotion
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\Column(type="string", length=50)
  20.      */
  21.     private $prm_nom;
  22.     /**
  23.      * @ORM\Column(type="float")
  24.      */
  25.     private $prm_reduction;
  26.     /**
  27.      * @ORM\ManyToOne(targetEntity=CentreGroupe::class, inversedBy="promotions")
  28.      * @ORM\JoinColumn(nullable=false)
  29.      */
  30.     private $centre_groupe;
  31.     /**
  32.      * @ORM\OneToMany(targetEntity=PromotionCreneau::class, mappedBy="promotion")
  33.      */
  34.     private $promotionCreneaus;
  35.     /**
  36.      * @ORM\ManyToMany(targetEntity=CentrePrestation::class, mappedBy="promotion_prestation", fetch="EAGER")
  37.      */
  38.     private $centrePrestations;
  39.     /**
  40.      * @ORM\Column(type="integer", nullable=true)
  41.      */
  42.     private $id_old;
  43.     /**
  44.      * @ORM\OneToMany(targetEntity=Rendezvous::class, mappedBy="promotion")
  45.      */
  46.     private $rendezvouses;
  47.     public function __construct()
  48.     {
  49.         $this->promotionCreneaus = new ArrayCollection();
  50.         $this->centrePrestations = new ArrayCollection();
  51.         $this->rendezvouses = new ArrayCollection();
  52.     }
  53.     public function getId(): ?int
  54.     {
  55.         return $this->id;
  56.     }
  57.     public function getPrmNom(): ?string
  58.     {
  59.         return $this->prm_nom;
  60.     }
  61.     public function setPrmNom(string $prm_nom): self
  62.     {
  63.         $this->prm_nom $prm_nom;
  64.         return $this;
  65.     }
  66.     public function getPrmReduction(): ?float
  67.     {
  68.         return $this->prm_reduction;
  69.     }
  70.     public function setPrmReduction(float $prm_reduction): self
  71.     {
  72.         $this->prm_reduction $prm_reduction;
  73.         return $this;
  74.     }
  75.     public function getCentreGroupe(): ?CentreGroupe
  76.     {
  77.         return $this->centre_groupe;
  78.     }
  79.     public function setCentreGroupe(?CentreGroupe $prm_centre_groupe): self
  80.     {
  81.         $this->centre_groupe $prm_centre_groupe;
  82.         return $this;
  83.     }
  84.     /**
  85.      * @return Collection<int, PromotionCreneau>
  86.      */
  87.     public function getPromotionCreneaus(): Collection
  88.     {
  89.         return $this->promotionCreneaus;
  90.     }
  91.     public function addPromotionCreneau(PromotionCreneau $promotionCreneau): self
  92.     {
  93.         if (!$this->promotionCreneaus->contains($promotionCreneau)) {
  94.             $this->promotionCreneaus[] = $promotionCreneau;
  95.             $promotionCreneau->setPromotion($this);
  96.         }
  97.         return $this;
  98.     }
  99.     public function removePromotionCreneau(PromotionCreneau $promotionCreneau): self
  100.     {
  101.         if ($this->promotionCreneaus->removeElement($promotionCreneau)) {
  102.             // set the owning side to null (unless already changed)
  103.             if ($promotionCreneau->getPromotion() === $this) {
  104.                 $promotionCreneau->setPromotion(null);
  105.             }
  106.         }
  107.         return $this;
  108.     }
  109.     /**
  110.      * @return Collection<int, CentrePrestation>
  111.      */
  112.     public function getCentrePrestations(): Collection
  113.     {
  114.         return $this->centrePrestations;
  115.     }
  116.     public function addCentrePrestation(CentrePrestation $centrePrestation): self
  117.     {
  118.         if (!$this->centrePrestations->contains($centrePrestation)) {
  119.             $this->centrePrestations[] = $centrePrestation;
  120.             $centrePrestation->addPromotionPrestation($this);
  121.         }
  122.         return $this;
  123.     }
  124.     public function removeCentrePrestation(CentrePrestation $centrePrestation): self
  125.     {
  126.         if ($this->centrePrestations->removeElement($centrePrestation)) {
  127.             $centrePrestation->removePromotionPrestation($this);
  128.         }
  129.         return $this;
  130.     }
  131.     public function getIdOld(): ?int
  132.     {
  133.         return $this->id_old;
  134.     }
  135.     public function setIdOld(int $id_old): self
  136.     {
  137.         $this->id_old $id_old;
  138.         return $this;
  139.     }
  140.     /**
  141.      * @return Collection<int, Rendezvous>
  142.      */
  143.     public function getRendezvouses(): Collection
  144.     {
  145.         return $this->rendezvouses;
  146.     }
  147.     public function addRendezvouse(Rendezvous $rendezvouse): self
  148.     {
  149.         if (!$this->rendezvouses->contains($rendezvouse)) {
  150.             $this->rendezvouses[] = $rendezvouse;
  151.             $rendezvouse->setPromotion($this);
  152.         }
  153.         return $this;
  154.     }
  155.     public function removeRendezvouse(Rendezvous $rendezvouse): self
  156.     {
  157.         if ($this->rendezvouses->removeElement($rendezvouse)) {
  158.             // set the owning side to null (unless already changed)
  159.             if ($rendezvouse->getPromotion() === $this) {
  160.                 $rendezvouse->setPromotion(null);
  161.             }
  162.         }
  163.         return $this;
  164.     }
  165. }