<?php
namespace App\Entity;
use App\Repository\OffreRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: OffreRepository::class)]
class Offre
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255)]
private ?string $titre = null;
#[ORM\Column(length: 255)]
private ?string $description = null;
#[ORM\Column]
private ?int $point = null;
#[ORM\Column(length: 255)]
private ?string $modalTitre = null;
#[ORM\Column(length: 255)]
private ?string $modalDescription = null;
#[ORM\Column(length: 255)]
private ?string $imagePath = null;
#[ORM\OneToMany(mappedBy: 'offre', targetEntity: CouponUser::class)]
private Collection $couponUsers;
#[ORM\Column(length: 255, nullable: true)]
private ?string $type = null;
#[ORM\Column(nullable: true)]
private ?int $reduction = null;
#[ORM\OneToMany(mappedBy: 'offre', targetEntity: TicketGratter::class)]
private Collection $ticketGratters;
public function __construct()
{
$this->couponUsers = new ArrayCollection();
$this->ticketGratters = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getTitre(): ?string
{
return $this->titre;
}
public function setTitre(string $titre): static
{
$this->titre = $titre;
return $this;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(string $description): static
{
$this->description = $description;
return $this;
}
public function getPoint(): ?int
{
return $this->point;
}
public function setPoint(int $point): static
{
$this->point = $point;
return $this;
}
public function getModalTitre(): ?string
{
return $this->modalTitre;
}
public function setModalTitre(string $modalTitre): static
{
$this->modalTitre = $modalTitre;
return $this;
}
public function getModalDescription(): ?string
{
return $this->modalDescription;
}
public function setModalDescription(string $modalDescription): static
{
$this->modalDescription = $modalDescription;
return $this;
}
public function getImagePath(): ?string
{
return $this->imagePath;
}
public function setImagePath(string $imagePath): static
{
$this->imagePath = $imagePath;
return $this;
}
/**
* @return Collection<int, CouponUser>
*/
public function getCouponUsers(): Collection
{
return $this->couponUsers;
}
public function addCouponUser(CouponUser $couponUser): static
{
if (!$this->couponUsers->contains($couponUser)) {
$this->couponUsers->add($couponUser);
$couponUser->setOffre($this);
}
return $this;
}
public function removeCouponUser(CouponUser $couponUser): static
{
if ($this->couponUsers->removeElement($couponUser)) {
// set the owning side to null (unless already changed)
if ($couponUser->getOffre() === $this) {
$couponUser->setOffre(null);
}
}
return $this;
}
public function getType(): ?string
{
return $this->type;
}
public function setType(?string $type): static
{
$this->type = $type;
return $this;
}
public function getReduction(): ?int
{
return $this->reduction;
}
public function setReduction(?int $reduction): static
{
$this->reduction = $reduction;
return $this;
}
/**
* @return Collection<int, TicketGratter>
*/
public function getTicketGratters(): Collection
{
return $this->ticketGratters;
}
public function addTicketGratter(TicketGratter $ticketGratter): static
{
if (!$this->ticketGratters->contains($ticketGratter)) {
$this->ticketGratters->add($ticketGratter);
$ticketGratter->setOffre($this);
}
return $this;
}
public function removeTicketGratter(TicketGratter $ticketGratter): static
{
if ($this->ticketGratters->removeElement($ticketGratter)) {
// set the owning side to null (unless already changed)
if ($ticketGratter->getOffre() === $this) {
$ticketGratter->setOffre(null);
}
}
return $this;
}
}