<?phpnamespace App\Entity;use App\Repository\LotCouponRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\DBAL\Types\Types;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: LotCouponRepository::class)]class LotCoupon{ #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column] private ?int $id = null; #[ORM\Column(length: 255, nullable: true)] private ?string $libelle = null; #[ORM\Column(nullable: true)] private ?int $quantiteInitiale = null; #[ORM\Column(nullable: true)] private ?int $seuilAlerte = null; #[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)] private ?\DateTimeInterface $dateGeneration = null; // Déplacé ici ! #[ORM\Column(type: Types::DATE_MUTABLE, nullable: true)] private ?\DateTimeInterface $dateExpiration = null; // Déplacé ici ! #[ORM\ManyToOne(inversedBy: 'lotCoupons')] private ?Evenement $evenement = null; #[ORM\OneToMany(mappedBy: 'lotCoupon', targetEntity: Coupon::class,cascade: ['persist','remove'])] private Collection $coupons; #[ORM\Column(nullable: true)] private ?int $stock = null; #[ORM\Column(nullable: true)] private ?float $pourcentage = null; #[ORM\Column(nullable: true)] private ?bool $isActif = null; public function __construct() { $this->coupons = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getLibelle(): ?string { return $this->libelle; } public function setLibelle(?string $libelle): self { $this->libelle = $libelle; return $this; } public function getQuantiteInitiale(): ?int { return $this->quantiteInitiale; } public function setQuantiteInitiale(?int $quantiteInitiale): self { $this->quantiteInitiale = $quantiteInitiale; return $this; } public function getSeuilAlerte(): ?int { return $this->seuilAlerte; } public function setSeuilAlerte(?int $seuilAlerte): self { $this->seuilAlerte = $seuilAlerte; return $this; } public function getEvenement(): ?Evenement { return $this->evenement; } public function setEvenement(?Evenement $evenement): self { $this->evenement = $evenement; return $this; } public function getDateGeneration(): ?\DateTimeInterface { return $this->dateGeneration; } public function setDateGeneration(?\DateTimeInterface $dateGeneration): self { $this->dateGeneration = $dateGeneration; return $this; } public function getDateExpiration(): ?\DateTimeInterface { return $this->dateExpiration; } public function setDateExpiration(?\DateTimeInterface $dateExpiration): self { $this->dateExpiration = $dateExpiration; return $this; } /** * @return Collection<int, Coupon> */ public function getCoupons(): Collection { return $this->coupons; } public function addCoupon(Coupon $coupon): self { if (!$this->coupons->contains($coupon)) { $this->coupons->add($coupon); $coupon->setLotCoupon($this); } return $this; } public function removeCoupon(Coupon $coupon): self { if ($this->coupons->removeElement($coupon)) { // set the owning side to null (unless already changed) if ($coupon->getLotCoupon() === $this) { $coupon->setLotCoupon(null); } } return $this; } public function getStock(): ?int { return $this->stock; } public function setStock(?int $stock): self { $this->stock = $stock; return $this; } public function getPourcentage(): ?float { return $this->pourcentage; } public function setPourcentage(?float $pourcentage): self { $this->pourcentage = $pourcentage; return $this; } public function isIsActif(): ?bool { return $this->isActif; } public function setIsActif(?bool $isActif): self { $this->isActif = $isActif; return $this; }}