src/Entity/Offer.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\OfferRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Gedmo\Mapping\Annotation as Gedmo;
  8. /**
  9.  * @ORM\Entity(repositoryClass=OfferRepository::class)
  10.  */
  11. class Offer
  12. {
  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 $title;
  23.     /**
  24.      * Slug immuable et unique (ex: "st-lucie")
  25.      * @Gedmo\Slug(fields={"title"}, updatable=true, unique=true)
  26.      * @ORM\Column(type="string", length=180, unique=true)
  27.      */
  28.     private $slug;
  29.     /**
  30.      * @ORM\Column(type="string", length=255, nullable=true)
  31.      */
  32.     private $subtitle;
  33.     /**
  34.      * @ORM\Column(type="string", length=255, nullable=true)
  35.      */
  36.     private $description;
  37.     /**
  38.      * @ORM\Column(type="string", length=255, nullable=true)
  39.      */
  40.     private $img;
  41.     /**
  42.      * @ORM\Column(type="string", length=255, nullable=true)
  43.      */
  44.     private $durationText;
  45.     /**
  46.      * @ORM\Column(type="string", length=255, nullable=true)
  47.      */
  48.     private $dateText;
  49.     /**
  50.      * @ORM\Column(type="string", length=255, nullable=true)
  51.      */
  52.     private $priceFrom;
  53.     /**
  54.      * @ORM\Column(type="boolean", nullable=true)
  55.      */
  56.     private $isPublish;
  57.     /**
  58.      * @ORM\OneToMany(targetEntity=OfferHebergement::class, mappedBy="offer")
  59.      */
  60.     private $offerHebergements;
  61.     /**
  62.      * @ORM\ManyToOne(targetEntity=Destination::class, inversedBy="offers")
  63.      */
  64.     private $destination;
  65.     /**
  66.      * @ORM\ManyToOne(targetEntity=TypeVoyage::class, inversedBy="offers")
  67.      */
  68.     private $type;
  69.     /**
  70.      * @ORM\OneToMany(targetEntity=Formule::class, mappedBy="offer")
  71.      */
  72.     private $formules;
  73.     /**
  74.      * @ORM\OneToMany(targetEntity=Included::class, mappedBy="Offer")
  75.      */
  76.     private $includeds;
  77.     /**
  78.      * @ORM\Column(type="string", length=255, nullable=true)
  79.      */
  80.     private $includedText;
  81.     /**
  82.      * @ORM\Column(type="string", length=255, nullable=true)
  83.      */
  84.     private $summaryDuration;
  85.     /**
  86.      * @ORM\Column(type="string", length=255, nullable=true)
  87.      */
  88.     private $summaryFlights;
  89.     /**
  90.      * @ORM\Column(type="string", length=255, nullable=true)
  91.      */
  92.     private $summaryPaceMeals;
  93.     /**
  94.      * @ORM\Column(type="string", length=255, nullable=true)
  95.      */
  96.     private $summaryFrom;
  97.     /**
  98.      * @ORM\Column(type="string", length=255, nullable=true)
  99.      */
  100.     private $priceNote;
  101.     /**
  102.      * @ORM\OneToMany(targetEntity=Itinerary::class, mappedBy="offer")
  103.      */
  104.     private $itineraries;
  105.     /**
  106.      * @ORM\OneToMany(targetEntity=Highlight::class, mappedBy="offer")
  107.      */
  108.     private $highlights;
  109.     /**
  110.      * @ORM\OneToMany(targetEntity=HebergemntOffer::class, mappedBy="offer")
  111.      */
  112.     private $hebergemntOffers;
  113.     /**
  114.      * @ORM\OneToMany(targetEntity=Flight::class, mappedBy="offer")
  115.      */
  116.     private $flights;
  117.     /**
  118.      * @ORM\OneToMany(targetEntity=OfferInfo::class, mappedBy="offer")
  119.      */
  120.     private $offerInfos;
  121.     /**
  122.      * @ORM\Column(type="string", length=255, nullable=true)
  123.      */
  124.     private $brochure;
  125.     /**
  126.      * @ORM\OneToMany(targetEntity=OurOffer::class, mappedBy="offer")
  127.      */
  128.     private $ourOffers;
  129.     /**
  130.      * @ORM\Column(type="integer", nullable=true)
  131.      */
  132.     private $OurOffer;
  133.     /**
  134.      * @ORM\Column(type="string", length=255, nullable=true)
  135.      */
  136.     private $file;
  137.     /**
  138.      * @ORM\OneToMany(targetEntity=ItineraryPic::class, mappedBy="Offer")
  139.      */
  140.     private $itineraryPics;
  141.     /**
  142.      * @ORM\ManyToOne(targetEntity=Continent::class, inversedBy="offers")
  143.      */
  144.     private $continent;
  145.     public function __construct()
  146.     {
  147.         $this->offerHebergements = new ArrayCollection();
  148.         $this->formules = new ArrayCollection();
  149.         $this->includeds = new ArrayCollection();
  150.         $this->itineraries = new ArrayCollection();
  151.         $this->highlights = new ArrayCollection();
  152.         $this->hebergemntOffers = new ArrayCollection();
  153.         $this->flights = new ArrayCollection();
  154.         $this->offerInfos = new ArrayCollection();
  155.         $this->ourOffers = new ArrayCollection();
  156.         $this->itineraryPics = new ArrayCollection();
  157.     }
  158.     public function getId(): ?int
  159.     {
  160.         return $this->id;
  161.     }
  162.     public function getTitle(): ?string
  163.     {
  164.         return $this->title;
  165.     }
  166.     public function setTitle(?string $title): self
  167.     {
  168.         $this->title $title;
  169.         return $this;
  170.     }
  171.     public function getSubtitle(): ?string
  172.     {
  173.         return $this->subtitle;
  174.     }
  175.     public function setSubtitle(?string $subtitle): self
  176.     {
  177.         $this->subtitle $subtitle;
  178.         return $this;
  179.     }
  180.     public function getDescription(): ?string
  181.     {
  182.         return $this->description;
  183.     }
  184.     public function setDescription(?string $description): self
  185.     {
  186.         $this->description $description;
  187.         return $this;
  188.     }
  189.     public function getImg(): ?string
  190.     {
  191.         return $this->img;
  192.     }
  193.     public function setImg(?string $img): self
  194.     {
  195.         $this->img $img;
  196.         return $this;
  197.     }
  198.     public function getDurationText(): ?string
  199.     {
  200.         return $this->durationText;
  201.     }
  202.     public function setDurationText(?string $durationText): self
  203.     {
  204.         $this->durationText $durationText;
  205.         return $this;
  206.     }
  207.     public function getDateText(): ?string
  208.     {
  209.         return $this->dateText;
  210.     }
  211.     public function setDateText(?string $dateText): self
  212.     {
  213.         $this->dateText $dateText;
  214.         return $this;
  215.     }
  216.     public function getPriceFrom(): ?string
  217.     {
  218.         return $this->priceFrom;
  219.     }
  220.     public function setPriceFrom(?string $priceFrom): self
  221.     {
  222.         $this->priceFrom $priceFrom;
  223.         return $this;
  224.     }
  225.     public function isIsPublish(): ?bool
  226.     {
  227.         return $this->isPublish;
  228.     }
  229.     public function setIsPublish(?bool $isPublish): self
  230.     {
  231.         $this->isPublish $isPublish;
  232.         return $this;
  233.     }
  234.     public function getDestination(): ?Destination
  235.     {
  236.         return $this->destination;
  237.     }
  238.     public function setDestination(?Destination $destination): self
  239.     {
  240.         $this->destination $destination;
  241.         return $this;
  242.     }
  243.     public function getType(): ?TypeVoyage
  244.     {
  245.         return $this->type;
  246.     }
  247.     public function setType(?TypeVoyage $type): self
  248.     {
  249.         $this->type $type;
  250.         return $this;
  251.     }
  252.     /**
  253.      * @return Collection<int, Formule>
  254.      */
  255.     public function getFormules(): Collection
  256.     {
  257.         return $this->formules;
  258.     }
  259.     public function addFormule(Formule $formule): self
  260.     {
  261.         if (!$this->formules->contains($formule)) {
  262.             $this->formules[] = $formule;
  263.             $formule->setOffer($this);
  264.         }
  265.         return $this;
  266.     }
  267.     public function removeFormule(Formule $formule): self
  268.     {
  269.         if ($this->formules->removeElement($formule)) {
  270.             // set the owning side to null (unless already changed)
  271.             if ($formule->getOffer() === $this) {
  272.                 $formule->setOffer(null);
  273.             }
  274.         }
  275.         return $this;
  276.     }
  277.     /**
  278.      * @return Collection<int, Included>
  279.      */
  280.     public function getIncludeds(): Collection
  281.     {
  282.         return $this->includeds;
  283.     }
  284.     public function addIncluded(Included $included): self
  285.     {
  286.         if (!$this->includeds->contains($included)) {
  287.             $this->includeds[] = $included;
  288.             $included->setOffer($this);
  289.         }
  290.         return $this;
  291.     }
  292.     public function removeIncluded(Included $included): self
  293.     {
  294.         if ($this->includeds->removeElement($included)) {
  295.             // set the owning side to null (unless already changed)
  296.             if ($included->getOffer() === $this) {
  297.                 $included->setOffer(null);
  298.             }
  299.         }
  300.         return $this;
  301.     }
  302.     public function getIncludedText(): ?string
  303.     {
  304.         return $this->includedText;
  305.     }
  306.     public function setIncludedText(?string $includedText): self
  307.     {
  308.         $this->includedText $includedText;
  309.         return $this;
  310.     }
  311.     /**
  312.      * Get slug immuable et unique (ex: "st-lucie")
  313.      */ 
  314.     public function getSlug()
  315.     {
  316.         return $this->slug;
  317.     }
  318.     /**
  319.      * Set slug immuable et unique (ex: "st-lucie")
  320.      *
  321.      * @return  self
  322.      */ 
  323.     public function setSlug($slug)
  324.     {
  325.         $this->slug $slug;
  326.         return $this;
  327.     }
  328.     public function getSummaryDuration(): ?string
  329.     {
  330.         return $this->summaryDuration;
  331.     }
  332.     public function setSummaryDuration(?string $summaryDuration): self
  333.     {
  334.         $this->summaryDuration $summaryDuration;
  335.         return $this;
  336.     }
  337.     public function getSummaryFlights(): ?string
  338.     {
  339.         return $this->summaryFlights;
  340.     }
  341.     public function setSummaryFlights(?string $summaryFlights): self
  342.     {
  343.         $this->summaryFlights $summaryFlights;
  344.         return $this;
  345.     }
  346.     public function getSummaryPaceMeals(): ?string
  347.     {
  348.         return $this->summaryPaceMeals;
  349.     }
  350.     public function setSummaryPaceMeals(?string $summaryPaceMeals): self
  351.     {
  352.         $this->summaryPaceMeals $summaryPaceMeals;
  353.         return $this;
  354.     }
  355.     public function getSummaryFrom(): ?string
  356.     {
  357.         return $this->summaryFrom;
  358.     }
  359.     public function setSummaryFrom(?string $summaryFrom): self
  360.     {
  361.         $this->summaryFrom $summaryFrom;
  362.         return $this;
  363.     }
  364.     public function getPriceNote(): ?string
  365.     {
  366.         return $this->priceNote;
  367.     }
  368.     public function setPriceNote(?string $priceNote): self
  369.     {
  370.         $this->priceNote $priceNote;
  371.         return $this;
  372.     }
  373.     /**
  374.      * @return Collection<int, Itinerary>
  375.      */
  376.     public function getItineraries(): Collection
  377.     {
  378.         return $this->itineraries;
  379.     }
  380.     public function addItinerary(Itinerary $itinerary): self
  381.     {
  382.         if (!$this->itineraries->contains($itinerary)) {
  383.             $this->itineraries[] = $itinerary;
  384.             $itinerary->setOffer($this);
  385.         }
  386.         return $this;
  387.     }
  388.     public function removeItinerary(Itinerary $itinerary): self
  389.     {
  390.         if ($this->itineraries->removeElement($itinerary)) {
  391.             // set the owning side to null (unless already changed)
  392.             if ($itinerary->getOffer() === $this) {
  393.                 $itinerary->setOffer(null);
  394.             }
  395.         }
  396.         return $this;
  397.     }
  398.     /**
  399.      * @return Collection<int, Highlight>
  400.      */
  401.     public function getHighlights(): Collection
  402.     {
  403.         return $this->highlights;
  404.     }
  405.     public function addHighlight(Highlight $highlight): self
  406.     {
  407.         if (!$this->highlights->contains($highlight)) {
  408.             $this->highlights[] = $highlight;
  409.             $highlight->setOffer($this);
  410.         }
  411.         return $this;
  412.     }
  413.     public function removeHighlight(Highlight $highlight): self
  414.     {
  415.         if ($this->highlights->removeElement($highlight)) {
  416.             // set the owning side to null (unless already changed)
  417.             if ($highlight->getOffer() === $this) {
  418.                 $highlight->setOffer(null);
  419.             }
  420.         }
  421.         return $this;
  422.     }
  423.     /**
  424.      * @return Collection<int, HebergemntOffer>
  425.      */
  426.     public function getHebergemntOffers(): Collection
  427.     {
  428.         return $this->hebergemntOffers;
  429.     }
  430.     public function addHebergemntOffer(HebergemntOffer $hebergemntOffer): self
  431.     {
  432.         if (!$this->hebergemntOffers->contains($hebergemntOffer)) {
  433.             $this->hebergemntOffers[] = $hebergemntOffer;
  434.             $hebergemntOffer->setOffer($this);
  435.         }
  436.         return $this;
  437.     }
  438.     public function removeHebergemntOffer(HebergemntOffer $hebergemntOffer): self
  439.     {
  440.         if ($this->hebergemntOffers->removeElement($hebergemntOffer)) {
  441.             // set the owning side to null (unless already changed)
  442.             if ($hebergemntOffer->getOffer() === $this) {
  443.                 $hebergemntOffer->setOffer(null);
  444.             }
  445.         }
  446.         return $this;
  447.     }
  448.     /**
  449.      * @return Collection<int, Flight>
  450.      */
  451.     public function getFlights(): Collection
  452.     {
  453.         return $this->flights;
  454.     }
  455.     public function addFlight(Flight $flight): self
  456.     {
  457.         if (!$this->flights->contains($flight)) {
  458.             $this->flights[] = $flight;
  459.             $flight->setOffer($this);
  460.         }
  461.         return $this;
  462.     }
  463.     public function removeFlight(Flight $flight): self
  464.     {
  465.         if ($this->flights->removeElement($flight)) {
  466.             // set the owning side to null (unless already changed)
  467.             if ($flight->getOffer() === $this) {
  468.                 $flight->setOffer(null);
  469.             }
  470.         }
  471.         return $this;
  472.     }
  473.     /**
  474.      * @return Collection<int, OfferInfo>
  475.      */
  476.     public function getOfferInfos(): Collection
  477.     {
  478.         return $this->offerInfos;
  479.     }
  480.     public function addOfferInfo(OfferInfo $offerInfo): self
  481.     {
  482.         if (!$this->offerInfos->contains($offerInfo)) {
  483.             $this->offerInfos[] = $offerInfo;
  484.             $offerInfo->setOffer($this);
  485.         }
  486.         return $this;
  487.     }
  488.     public function removeOfferInfo(OfferInfo $offerInfo): self
  489.     {
  490.         if ($this->offerInfos->removeElement($offerInfo)) {
  491.             // set the owning side to null (unless already changed)
  492.             if ($offerInfo->getOffer() === $this) {
  493.                 $offerInfo->setOffer(null);
  494.             }
  495.         }
  496.         return $this;
  497.     }
  498.     public function getBrochure(): ?string
  499.     {
  500.         return $this->brochure;
  501.     }
  502.     public function setBrochure(?string $brochure): self
  503.     {
  504.         $this->brochure $brochure;
  505.         return $this;
  506.     }
  507.     /**
  508.      * @return Collection<int, OurOffer>
  509.      */
  510.     public function getOurOffers(): Collection
  511.     {
  512.         return $this->ourOffers;
  513.     }
  514.     public function addOurOffer(OurOffer $ourOffer): self
  515.     {
  516.         if (!$this->ourOffers->contains($ourOffer)) {
  517.             $this->ourOffers[] = $ourOffer;
  518.             $ourOffer->setOffer($this);
  519.         }
  520.         return $this;
  521.     }
  522.     public function removeOurOffer(OurOffer $ourOffer): self
  523.     {
  524.         if ($this->ourOffers->removeElement($ourOffer)) {
  525.             // set the owning side to null (unless already changed)
  526.             if ($ourOffer->getOffer() === $this) {
  527.                 $ourOffer->setOffer(null);
  528.             }
  529.         }
  530.         return $this;
  531.     }
  532.     public function getOurOffer(): ?int
  533.     {
  534.         return $this->OurOffer;
  535.     }
  536.     public function setOurOffer(?int $OurOffer): self
  537.     {
  538.         $this->OurOffer $OurOffer;
  539.         return $this;
  540.     }
  541.     public function getFile(): ?string
  542.     {
  543.         return $this->file;
  544.     }
  545.     public function setFile(?string $file): self
  546.     {
  547.         $this->file $file;
  548.         return $this;
  549.     }
  550.     /**
  551.      * @return Collection<int, ItineraryPic>
  552.      */
  553.     public function getItineraryPics(): Collection
  554.     {
  555.         return $this->itineraryPics;
  556.     }
  557.     public function addItineraryPic(ItineraryPic $itineraryPic): self
  558.     {
  559.         if (!$this->itineraryPics->contains($itineraryPic)) {
  560.             $this->itineraryPics[] = $itineraryPic;
  561.             $itineraryPic->setOffer($this);
  562.         }
  563.         return $this;
  564.     }
  565.     public function removeItineraryPic(ItineraryPic $itineraryPic): self
  566.     {
  567.         if ($this->itineraryPics->removeElement($itineraryPic)) {
  568.             // set the owning side to null (unless already changed)
  569.             if ($itineraryPic->getOffer() === $this) {
  570.                 $itineraryPic->setOffer(null);
  571.             }
  572.         }
  573.         return $this;
  574.     }
  575.     public function getContinent(): ?Continent
  576.     {
  577.         return $this->continent;
  578.     }
  579.     public function setContinent(?Continent $continent): self
  580.     {
  581.         $this->continent $continent;
  582.         return $this;
  583.     }
  584. }