src/Entity/Main/Forfait.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Main;
  3. use App\Repository\ForfaitRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. /**
  8.  * @ORM\Entity(repositoryClass=ForfaitRepository::class)
  9.  */
  10. class Forfait
  11. {
  12.     public const COLOR_DEFAULT '#898887';
  13.     /**
  14.      * @ORM\Id
  15.      * @ORM\GeneratedValue
  16.      * @ORM\Column(type="integer")
  17.      */
  18.     private $id;
  19.     /**
  20.      * @ORM\Column(type="string", length=255, nullable=true)
  21.      */
  22.     private $designation;
  23.     /**
  24.      * @ORM\Column(type="string", length=255, nullable=true)
  25.      */
  26.     private $information;
  27.     /**
  28.      * @ORM\Column(type="boolean", nullable=true)
  29.      */
  30.     private $is_pass_kids;
  31.     /**
  32.      * @ORM\Column(type="boolean", nullable=true)
  33.      */
  34.     private $is_pass_famille;
  35.     /**
  36.      * @ORM\Column(type="string", length=10, nullable=true)
  37.      */
  38.     private $pass_color self::COLOR_DEFAULT;
  39.     /**
  40.      * @ORM\Column(type="integer", nullable=true)
  41.      */
  42.     private $nbre_activites;
  43.     /**
  44.      * @ORM\Column(type="integer", nullable=true)
  45.      */
  46.     private $priority;
  47.     /**
  48.      * @ORM\Column(type="boolean")
  49.      */
  50.     private $is_active;
  51.     /**
  52.      * @ORM\Column(type="string", length=255, nullable=true)
  53.      */
  54.     private $urlForfait;
  55.     
  56.     /**
  57.      * @ORM\ManyToOne(targetEntity="App\Entity\Main\Formule", inversedBy="forfaits")
  58.      */
  59.     private $formule;
  60.     /**
  61.      * @ORM\ManyToMany(targetEntity="App\Entity\Main\Activity", cascade={"persist"})
  62.      * @ORM\JoinTable(name="forfaits_includedactivities")
  63.      */
  64.     private $activities_included;
  65.     /**
  66.      * @ORM\ManyToMany(targetEntity="App\Entity\Main\Activity", cascade={"persist"})
  67.      * @ORM\JoinTable(name="forfaits_choicedactivities")
  68.      */
  69.     private $activities_choiced;
  70.     /**
  71.      * @ORM\OneToMany(targetEntity="App\Entity\Main\Price", mappedBy="forfait", cascade={"persist", "remove"}, orphanRemoval=true)
  72.      */
  73.     private $prices;
  74.     /**
  75.      * @ORM\OneToMany(targetEntity="App\Entity\Main\ActivityOptions", mappedBy="forfait")
  76.      */
  77.     private $activityOptions;
  78.     /**
  79.      * @ORM\OneToMany(targetEntity="App\Entity\Main\Promos", mappedBy="forfait")
  80.      */
  81.     private $promos;
  82.     /**
  83.      * @ORM\OneToMany(targetEntity="App\Entity\Main\PromosOptions", mappedBy="forfait")
  84.      */
  85.     private $promosOptions;
  86.     /**
  87.      * @ORM\Column(type="integer", nullable=true)
  88.      */
  89.     private $minParticipants;
  90.     /**
  91.      * @ORM\ManyToMany(targetEntity=CartoBon::class, mappedBy="forfait")
  92.      */
  93.     private $cartoBons;
  94.     /**
  95.      * @ORM\Column(type="boolean", nullable=true)
  96.      */
  97.     private $is_new;
  98.     /**
  99.      * @ORM\Column(type="boolean", nullable=true)
  100.      */
  101.     private $is_shortly;
  102.     public function __construct()
  103.     {
  104.         $this->activities_included = new ArrayCollection();
  105.         $this->activities_choiced = new ArrayCollection();
  106.         $this->options = new ArrayCollection();
  107.         $this->prices = new ArrayCollection();
  108.         $this->activityOptions = new ArrayCollection();
  109.         $this->promos = new ArrayCollection();
  110.         $this->promosOptions = new ArrayCollection();
  111.         $this->childrens = new ArrayCollection();
  112.         $this->cartoBons = new ArrayCollection();
  113.     }
  114.     public function __toString()
  115.     {
  116.         return (string) $this->designation ' (' $this->formule ')';
  117.     }   
  118.     public function getId(): ?int
  119.     {
  120.         return $this->id;
  121.     }
  122.     public function getDesignation(): ?string
  123.     {
  124.         return $this->designation;
  125.     }
  126.     public function setDesignation(?string $designation): self
  127.     {
  128.         $this->designation $designation;
  129.         return $this;
  130.     }
  131.     public function getInformation(): ?string
  132.     {
  133.         return $this->information;
  134.     }
  135.     public function setInformation(?string $information): self
  136.     {
  137.         $this->information $information;
  138.         return $this;
  139.     }
  140.     public function getIsPassKids(): ?bool
  141.     {
  142.         return $this->is_pass_kids;
  143.     }
  144.     public function setIsPassKids(?bool $is_pass_kids): self
  145.     {
  146.         $this->is_pass_kids $is_pass_kids;
  147.         return $this;
  148.     }
  149.     public function getIsPassFamille(): ?bool
  150.     {
  151.         return $this->is_pass_famille;
  152.     }
  153.     public function setIsPassFamille(?bool $is_pass_famille): self
  154.     {
  155.         $this->is_pass_famille $is_pass_famille;
  156.         return $this;
  157.     }
  158.     public function getPassColor(): ?string
  159.     {
  160.         return $this->pass_color $this->pass_color self::COLOR_DEFAULT;
  161.     }
  162.     public function setPassColor(?string $pass_color): self
  163.     {
  164.         $this->pass_color $pass_color;
  165.         return $this;
  166.     }
  167.     public function getNbreActivites(): ?int
  168.     {
  169.         return $this->nbre_activites;
  170.     }
  171.     public function setNbreActivites(?int $nbre_activites): self
  172.     {
  173.         $this->nbre_activites $nbre_activites;
  174.         return $this;
  175.     }
  176.     public function getPriority(): ?int
  177.     {
  178.         return $this->priority;
  179.     }
  180.     public function setPriority(?int $priority): self
  181.     {
  182.         $this->priority $priority;
  183.         return $this;
  184.     }
  185.     public function getIsActive(): ?bool
  186.     {
  187.         return $this->is_active;
  188.     }
  189.     public function setIsActive(bool $is_active): self
  190.     {
  191.         $this->is_active $is_active;
  192.         return $this;
  193.     }
  194.     public function getUrlForfait(): ?string
  195.     {
  196.         return $this->urlForfait;
  197.     }
  198.     public function setUrlForfait(?string $urlForfait): self
  199.     {
  200.         $this->urlForfait $urlForfait;
  201.         return $this;
  202.     }
  203.     /**
  204.      * @return Collection|Activity[]
  205.      */
  206.     public function getActivitiesIncluded(): Collection
  207.     {
  208.         return $this->activities_included;
  209.     }
  210.     public function addActivitiesIncluded(Activity $activitiesIncluded): self
  211.     {
  212.         if (!$this->activities_included->contains($activitiesIncluded)) {
  213.             $this->activities_included[] = $activitiesIncluded;
  214.         }
  215.         return $this;
  216.     }
  217.     public function removeActivitiesIncluded(Activity $activitiesIncluded): self
  218.     {
  219.         if ($this->activities_included->contains($activitiesIncluded)) {
  220.             $this->activities_included->removeElement($activitiesIncluded);
  221.         }
  222.         return $this;
  223.     }
  224.     public function getFormule(): ?Formule
  225.     {
  226.         return $this->formule;
  227.     }
  228.     public function setFormule(?Formule $formule): self
  229.     {
  230.         $this->formule $formule;
  231.         return $this;
  232.     }
  233.     /**
  234.      * @return Collection|Activity[]
  235.      */
  236.     public function getActivitiesChoiced(): Collection
  237.     {
  238.         return $this->activities_choiced;
  239.     }
  240.     public function addActivitiesChoiced(Activity $activitiesChoiced): self
  241.     {
  242.         if (!$this->activities_choiced->contains($activitiesChoiced)) {
  243.             $this->activities_choiced[] = $activitiesChoiced;
  244.         }
  245.         return $this;
  246.     }
  247.     public function removeActivitiesChoiced(Activity $activitiesChoiced): self
  248.     {
  249.         if ($this->activities_choiced->contains($activitiesChoiced)) {
  250.             $this->activities_choiced->removeElement($activitiesChoiced);
  251.         }
  252.         return $this;
  253.     }
  254.     /**
  255.      * @return Collection|Price[]
  256.      */
  257.     public function getPrices(): Collection
  258.     {
  259.         return $this->prices;
  260.     }
  261.     public function addPrice(Price $price): self
  262.     {
  263.         if (!$this->prices->contains($price)) {
  264.             $this->prices[] = $price;
  265.             $price->setForfait($this);
  266.         }
  267.         return $this;
  268.     }
  269.     public function removePrice(Price $price): self
  270.     {
  271.         if ($this->prices->contains($price)) {
  272.             $this->prices->removeElement($price);
  273.             // set the owning side to null (unless already changed)
  274.             if ($price->getForfait() === $this) {
  275.                 $price->setForfait(null);
  276.             }
  277.         }
  278.         return $this;
  279.     }
  280.     /**
  281.      * @return Collection|ActivityOptions[]
  282.      */
  283.     public function getActivityOptions(): Collection
  284.     {
  285.         return $this->activityOptions;
  286.     }
  287.     public function addActivityOption(ActivityOptions $activityOption): self
  288.     {
  289.         if (!$this->activityOptions->contains($activityOption)) {
  290.             $this->activityOptions[] = $activityOption;
  291.             $activityOption->setForfait($this);
  292.         }
  293.         return $this;
  294.     }
  295.     public function removeActivityOption(ActivityOptions $activityOption): self
  296.     {
  297.         if ($this->activityOptions->contains($activityOption)) {
  298.             $this->activityOptions->removeElement($activityOption);
  299.             // set the owning side to null (unless already changed)
  300.             if ($activityOption->getForfait() === $this) {
  301.                 $activityOption->setForfait(null);
  302.             }
  303.         }
  304.         return $this;
  305.     }
  306.     /**
  307.      * @return Collection|Promos[]
  308.      */
  309.     public function getPromos(): Collection
  310.     {
  311.         return $this->promos;
  312.     }
  313.     public function addPromo(Promos $promo): self
  314.     {
  315.         if (!$this->promos->contains($promo)) {
  316.             $this->promos[] = $promo;
  317.             $promo->setForfait($this);
  318.         }
  319.         return $this;
  320.     }
  321.     public function removePromo(Promos $promo): self
  322.     {
  323.         if ($this->promos->contains($promo)) {
  324.             $this->promos->removeElement($promo);
  325.             // set the owning side to null (unless already changed)
  326.             if ($promo->getForfait() === $this) {
  327.                 $promo->setForfait(null);
  328.             }
  329.         }
  330.         return $this;
  331.     }
  332.     /**
  333.      * @return Collection|PromosOptions[]
  334.      */
  335.     public function getPromosOptions(): Collection
  336.     {
  337.         return $this->promosOptions;
  338.     }
  339.     public function addPromosOption(PromosOptions $promosOption): self
  340.     {
  341.         if (!$this->promosOptions->contains($promosOption)) {
  342.             $this->promosOptions[] = $promosOption;
  343.             $promosOption->setForfait($this);
  344.         }
  345.         return $this;
  346.     }
  347.     public function removePromosOption(PromosOptions $promosOption): self
  348.     {
  349.         if ($this->promosOptions->contains($promosOption)) {
  350.             $this->promosOptions->removeElement($promosOption);
  351.             // set the owning side to null (unless already changed)
  352.             if ($promosOption->getForfait() === $this) {
  353.                 $promosOption->setForfait(null);
  354.             }
  355.         }
  356.         return $this;
  357.     }
  358.     public function getMinParticipants(): ?int
  359.     {
  360.         return $this->minParticipants;
  361.     }
  362.     public function setMinParticipants(?int $minParticipants): self
  363.     {
  364.         $this->minParticipants $minParticipants;
  365.         return $this;
  366.     }
  367.     /**
  368.      * @return Collection|CartoBon[]
  369.      */
  370.     public function getCartoBons(): Collection
  371.     {
  372.         return $this->cartoBons;
  373.     }
  374.     public function addCartoBon(CartoBon $cartoBon): self
  375.     {
  376.         if (!$this->cartoBons->contains($cartoBon)) {
  377.             $this->cartoBons[] = $cartoBon;
  378.             $cartoBon->addForfait($this);
  379.         }
  380.         return $this;
  381.     }
  382.     public function removeCartoBon(CartoBon $cartoBon): self
  383.     {
  384.         if ($this->cartoBons->removeElement($cartoBon)) {
  385.             $cartoBon->removeForfait($this);
  386.         }
  387.         return $this;
  388.     }
  389.     public function getIsNew(): ?bool
  390.     {
  391.         return $this->is_new;
  392.     }
  393.     public function setIsNew(?bool $is_new): self
  394.     {
  395.         $this->is_new $is_new;
  396.         return $this;
  397.     }
  398.     public function getIsShortly(): ?bool
  399.     {
  400.         return $this->is_shortly;
  401.     }
  402.     public function setIsShortly(?bool $is_shortly): self
  403.     {
  404.         $this->is_shortly $is_shortly;
  405.         return $this;
  406.     }
  407. }