Linux SRV-16 6.18.44-paas #1 SMP PREEMPT_DYNAMIC Thu Aug 13 10:08:12 UTC 2026 x86_64
/
srv
/
data
/
web
/
vhosts
/
www.humitest.fr
/
htdocs
/
src
/
Entity
/
/srv/data/web/vhosts/www.humitest.fr/htdocs/src/Entity/CategoryDiscount.php
<?php namespace App\Entity; use App\Repository\CategoryDiscountRepository; use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\Collection; use Doctrine\ORM\Mapping as ORM; /** * @ORM\Entity(repositoryClass=CategoryDiscountRepository::class) */ class CategoryDiscount { /** * @ORM\Id * @ORM\GeneratedValue * @ORM\Column(type="integer") */ private $id; /** * @ORM\Column(type="string", length=255) */ private $name; /** * @ORM\Column(type="string", length=255) */ private $codeUnlockDiscount; /** * @ORM\OneToMany(targetEntity=PriceDiscount::class, mappedBy="categoryDiscount") */ private $priceDiscounts; /** * @ORM\Column(type="datetime") */ private $startDate; /** * @ORM\Column(type="datetime") */ private $endDate; public function __construct() { $this->priceDiscounts = new ArrayCollection(); } public function __toString() { return $this->getName(); } public function getId(): ?int { return $this->id; } public function getName(): ?string { return $this->name; } public function setName(string $name): self { $this->name = $name; return $this; } public function getCodeUnlockDiscount(): ?string { return $this->codeUnlockDiscount; } public function setCodeUnlockDiscount(string $codeUnlockDiscount): self { $this->codeUnlockDiscount = $codeUnlockDiscount; return $this; } /** * @return Collection|PriceDiscount[] */ public function getPriceDiscounts(): Collection { return $this->priceDiscounts; } public function addPriceDiscount(PriceDiscount $priceDiscount): self { if (!$this->priceDiscounts->contains($priceDiscount)) { $this->priceDiscounts[] = $priceDiscount; $priceDiscount->setCategoryDiscount($this); } return $this; } public function removePriceDiscount(PriceDiscount $priceDiscount): self { if ($this->priceDiscounts->removeElement($priceDiscount)) { // set the owning side to null (unless already changed) if ($priceDiscount->getCategoryDiscount() === $this) { $priceDiscount->setCategoryDiscount(null); } } return $this; } public function getStartDate(): ?\DateTimeInterface { return $this->startDate; } public function setStartDate(\DateTimeInterface $startDate): self { $this->startDate = $startDate; return $this; } public function getEndDate(): ?\DateTimeInterface { return $this->endDate; } public function setEndDate(\DateTimeInterface $endDate): self { $this->endDate = $endDate; return $this; } }