src/Entity/Itinerary.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ItineraryRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=ItineraryRepository::class)
  9.  */
  10. class Itinerary
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\ManyToOne(targetEntity=Offer::class, inversedBy="itineraries")
  20.      */
  21.     private $offer;
  22.     /**
  23.      * @ORM\Column(type="string", length=255, nullable=true)
  24.      */
  25.     private $title;
  26.     /**
  27.      * @ORM\Column(type="string", length=255, nullable=true)
  28.      */
  29.     private $details;
  30.     /**
  31.      * @ORM\Column(type="string", length=255, nullable=true)
  32.      */
  33.     private $kmLabel;
  34.     /**
  35.      * @ORM\OneToMany(targetEntity=ItineraryPic::class, mappedBy="itinerary")
  36.      */
  37.     private $itineraryPics;
  38.     public function __construct()
  39.     {
  40.         $this->itineraryPics = new ArrayCollection();
  41.     }
  42.     public function getId(): ?int
  43.     {
  44.         return $this->id;
  45.     }
  46.     public function getOffer(): ?Offer
  47.     {
  48.         return $this->offer;
  49.     }
  50.     public function setOffer(?Offer $offer): self
  51.     {
  52.         $this->offer $offer;
  53.         return $this;
  54.     }
  55.     public function getTitle(): ?string
  56.     {
  57.         return $this->title;
  58.     }
  59.     public function setTitle(?string $title): self
  60.     {
  61.         $this->title $title;
  62.         return $this;
  63.     }
  64.     public function getDetails(): ?string
  65.     {
  66.         return $this->details;
  67.     }
  68.     public function setDetails(?string $details): self
  69.     {
  70.         $this->details $details;
  71.         return $this;
  72.     }
  73.     public function getKmLabel(): ?string
  74.     {
  75.         return $this->kmLabel;
  76.     }
  77.     public function setKmLabel(?string $kmLabel): self
  78.     {
  79.         $this->kmLabel $kmLabel;
  80.         return $this;
  81.     }
  82.     /**
  83.      * @return Collection<int, ItineraryPic>
  84.      */
  85.     public function getItineraryPics(): Collection
  86.     {
  87.         return $this->itineraryPics;
  88.     }
  89.     public function addItineraryPic(ItineraryPic $itineraryPic): self
  90.     {
  91.         if (!$this->itineraryPics->contains($itineraryPic)) {
  92.             $this->itineraryPics[] = $itineraryPic;
  93.             $itineraryPic->setItinerary($this);
  94.         }
  95.         return $this;
  96.     }
  97.     public function removeItineraryPic(ItineraryPic $itineraryPic): self
  98.     {
  99.         if ($this->itineraryPics->removeElement($itineraryPic)) {
  100.             // set the owning side to null (unless already changed)
  101.             if ($itineraryPic->getItinerary() === $this) {
  102.                 $itineraryPic->setItinerary(null);
  103.             }
  104.         }
  105.         return $this;
  106.     }
  107. }