src/Entity/Discount/DiscountCoupon.php line 16

  1. <?php
  2. declare(strict_types=1);
  3. namespace App\Entity\Discount;
  4. use App\Repository\Discount\DiscountCouponRepository;
  5. use Doctrine\ORM\Mapping\Column;
  6. use Doctrine\ORM\Mapping\Entity;
  7. use Doctrine\ORM\Mapping\GeneratedValue;
  8. use Doctrine\ORM\Mapping\Id;
  9. use Doctrine\ORM\Mapping\Table;
  10. #[Entity(repositoryClass: DiscountCouponRepository::class)]
  11. #[Table(name: 'app_discount_coupon')]
  12. class DiscountCoupon
  13. {
  14.     #[Id]
  15.     #[Column(type: 'integer')]
  16.     #[GeneratedValue]
  17.     private ?int $id = null;
  18.     #[Column(type: 'integer')]
  19.     private int $used;
  20.     #[Column(type: 'integer')]
  21.     private int $usageLimit;
  22.     #[Column(type: 'string')]
  23.     private string $code;
  24.     #[Column(type: 'integer')]
  25.     private int $discountValue;
  26.     public function getId(): ?int
  27.     {
  28.         return $this->id;
  29.     }
  30.     public function getUsed(): int
  31.     {
  32.         return $this->used;
  33.     }
  34.     public function setUsed(int $used): DiscountCoupon
  35.     {
  36.         $this->used = $used;
  37.         return $this;
  38.     }
  39.     public function incrementUsed(): DiscountCoupon
  40.     {
  41.         ++$this->used;
  42.         return $this;
  43.     }
  44.     public function getUsageLimit(): int
  45.     {
  46.         return $this->usageLimit;
  47.     }
  48.     public function setUsageLimit(int $usageLimit): DiscountCoupon
  49.     {
  50.         $this->usageLimit = $usageLimit;
  51.         return $this;
  52.     }
  53.     public function getCode(): string
  54.     {
  55.         return $this->code;
  56.     }
  57.     public function setCode(string $code): DiscountCoupon
  58.     {
  59.         $this->code = $code;
  60.         return $this;
  61.     }
  62.     public function getDiscountValue(): int
  63.     {
  64.         return $this->discountValue;
  65.     }
  66.     public function setDiscountValue(int $discountValue): DiscountCoupon
  67.     {
  68.         $this->discountValue = $discountValue;
  69.         return $this;
  70.     }
  71. }