src/Entity/Offre.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\OffreRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassOffreRepository::class)]
  8. class Offre
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column]
  13.     private ?int $id null;
  14.     #[ORM\Column(length255)]
  15.     private ?string $titre null;
  16.     #[ORM\Column(length255)]
  17.     private ?string $description null;
  18.     #[ORM\Column]
  19.     private ?int $point null;
  20.     #[ORM\Column(length255)]
  21.     private ?string $modalTitre null;
  22.     #[ORM\Column(length255)]
  23.     private ?string $modalDescription null;
  24.     #[ORM\Column(length255)]
  25.     private ?string $imagePath null;
  26.     #[ORM\OneToMany(mappedBy'offre'targetEntityCouponUser::class)]
  27.     private Collection $couponUsers;
  28.     #[ORM\Column(length255nullabletrue)]
  29.     private ?string $type null;
  30.     #[ORM\Column(nullabletrue)]
  31.     private ?int $reduction null;
  32.     #[ORM\OneToMany(mappedBy'offre'targetEntityTicketGratter::class)]
  33.     private Collection $ticketGratters;
  34.     public function __construct()
  35.     {
  36.         $this->couponUsers = new ArrayCollection();
  37.         $this->ticketGratters = new ArrayCollection();
  38.     }
  39.     public function getId(): ?int
  40.     {
  41.         return $this->id;
  42.     }
  43.     public function getTitre(): ?string
  44.     {
  45.         return $this->titre;
  46.     }
  47.     public function setTitre(string $titre): static
  48.     {
  49.         $this->titre $titre;
  50.         return $this;
  51.     }
  52.     public function getDescription(): ?string
  53.     {
  54.         return $this->description;
  55.     }
  56.     public function setDescription(string $description): static
  57.     {
  58.         $this->description $description;
  59.         return $this;
  60.     }
  61.     public function getPoint(): ?int
  62.     {
  63.         return $this->point;
  64.     }
  65.     public function setPoint(int $point): static
  66.     {
  67.         $this->point $point;
  68.         return $this;
  69.     }
  70.     public function getModalTitre(): ?string
  71.     {
  72.         return $this->modalTitre;
  73.     }
  74.     public function setModalTitre(string $modalTitre): static
  75.     {
  76.         $this->modalTitre $modalTitre;
  77.         return $this;
  78.     }
  79.     public function getModalDescription(): ?string
  80.     {
  81.         return $this->modalDescription;
  82.     }
  83.     public function setModalDescription(string $modalDescription): static
  84.     {
  85.         $this->modalDescription $modalDescription;
  86.         return $this;
  87.     }
  88.     public function getImagePath(): ?string
  89.     {
  90.         return $this->imagePath;
  91.     }
  92.     public function setImagePath(string $imagePath): static
  93.     {
  94.         $this->imagePath $imagePath;
  95.         return $this;
  96.     }
  97.     /**
  98.      * @return Collection<int, CouponUser>
  99.      */
  100.     public function getCouponUsers(): Collection
  101.     {
  102.         return $this->couponUsers;
  103.     }
  104.     public function addCouponUser(CouponUser $couponUser): static
  105.     {
  106.         if (!$this->couponUsers->contains($couponUser)) {
  107.             $this->couponUsers->add($couponUser);
  108.             $couponUser->setOffre($this);
  109.         }
  110.         return $this;
  111.     }
  112.     public function removeCouponUser(CouponUser $couponUser): static
  113.     {
  114.         if ($this->couponUsers->removeElement($couponUser)) {
  115.             // set the owning side to null (unless already changed)
  116.             if ($couponUser->getOffre() === $this) {
  117.                 $couponUser->setOffre(null);
  118.             }
  119.         }
  120.         return $this;
  121.     }
  122.     public function getType(): ?string
  123.     {
  124.         return $this->type;
  125.     }
  126.     public function setType(?string $type): static
  127.     {
  128.         $this->type $type;
  129.         return $this;
  130.     }
  131.     public function getReduction(): ?int
  132.     {
  133.         return $this->reduction;
  134.     }
  135.     public function setReduction(?int $reduction): static
  136.     {
  137.         $this->reduction $reduction;
  138.         return $this;
  139.     }
  140.     /**
  141.      * @return Collection<int, TicketGratter>
  142.      */
  143.     public function getTicketGratters(): Collection
  144.     {
  145.         return $this->ticketGratters;
  146.     }
  147.     public function addTicketGratter(TicketGratter $ticketGratter): static
  148.     {
  149.         if (!$this->ticketGratters->contains($ticketGratter)) {
  150.             $this->ticketGratters->add($ticketGratter);
  151.             $ticketGratter->setOffre($this);
  152.         }
  153.         return $this;
  154.     }
  155.     public function removeTicketGratter(TicketGratter $ticketGratter): static
  156.     {
  157.         if ($this->ticketGratters->removeElement($ticketGratter)) {
  158.             // set the owning side to null (unless already changed)
  159.             if ($ticketGratter->getOffre() === $this) {
  160.                 $ticketGratter->setOffre(null);
  161.             }
  162.         }
  163.         return $this;
  164.     }
  165. }