src/Entity/TypeVoyage.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\TypeVoyageRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=TypeVoyageRepository::class)
  9.  */
  10. class TypeVoyage
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\Column(type="string", length=255, nullable=true)
  20.      */
  21.     private $name;
  22.     /**
  23.      * @ORM\Column(type="string", length=255, nullable=true)
  24.      */
  25.     private $description;
  26.     /**
  27.      * @ORM\Column(type="string", length=255, nullable=true)
  28.      */
  29.     private $img;
  30.     /**
  31.      * @ORM\OneToMany(targetEntity=Offer::class, mappedBy="type")
  32.      */
  33.     private $offers;
  34.     /**
  35.      * @ORM\Column(type="string", length=255, nullable=true)
  36.      */
  37.     private $color;
  38.     /**
  39.      * @ORM\Column(type="string", length=255, nullable=true)
  40.      */
  41.     private $hook;
  42.     public function __construct()
  43.     {
  44.         $this->offers = new ArrayCollection();
  45.     }
  46.     public function getId(): ?int
  47.     {
  48.         return $this->id;
  49.     }
  50.     public function getName(): ?string
  51.     {
  52.         return $this->name;
  53.     }
  54.     public function setName(?string $name): self
  55.     {
  56.         $this->name $name;
  57.         return $this;
  58.     }
  59.     public function getDescription(): ?string
  60.     {
  61.         return $this->description;
  62.     }
  63.     public function setDescription(?string $description): self
  64.     {
  65.         $this->description $description;
  66.         return $this;
  67.     }
  68.     public function getImg(): ?string
  69.     {
  70.         return $this->img;
  71.     }
  72.     public function setImg(?string $img): self
  73.     {
  74.         $this->img $img;
  75.         return $this;
  76.     }
  77.     /**
  78.      * @return Collection<int, Offer>
  79.      */
  80.     public function getOffers(): Collection
  81.     {
  82.         return $this->offers;
  83.     }
  84.     public function addOffer(Offer $offer): self
  85.     {
  86.         if (!$this->offers->contains($offer)) {
  87.             $this->offers[] = $offer;
  88.             $offer->setType($this);
  89.         }
  90.         return $this;
  91.     }
  92.     public function removeOffer(Offer $offer): self
  93.     {
  94.         if ($this->offers->removeElement($offer)) {
  95.             // set the owning side to null (unless already changed)
  96.             if ($offer->getType() === $this) {
  97.                 $offer->setType(null);
  98.             }
  99.         }
  100.         return $this;
  101.     }
  102.     public function getColor(): ?string
  103.     {
  104.         return $this->color;
  105.     }
  106.     public function setColor(?string $color): self
  107.     {
  108.         $this->color $color;
  109.         return $this;
  110.     }
  111.     public function getHook(): ?string
  112.     {
  113.         return $this->hook;
  114.     }
  115.     public function setHook(?string $hook): self
  116.     {
  117.         $this->hook $hook;
  118.         return $this;
  119.     }
  120. }