src/Entity/Shop/Order/Discount.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Shop\Order;
  3. use App\Entity\BaseEntity;
  4. use App\Entity\Shop\Product\Product;
  5. use App\Entity\Shop\Shop\Shop;
  6. use App\Repository\Shop\DiscountRepository;
  7. use Doctrine\DBAL\Types\Types;
  8. use Doctrine\ORM\Mapping as ORM;
  9. use Symfony\Bridge\Doctrine\IdGenerator\UuidGenerator;
  10. #[ORM\Entity(repositoryClassDiscountRepository::class)]
  11. class Discount extends BaseEntity
  12. {
  13.     #[ORM\Id]
  14.     #[ORM\Column(type'guid'uniquetrue)]
  15.     #[ORM\GeneratedValue(strategy'CUSTOM')]
  16.     #[ORM\CustomIdGenerator(class: UuidGenerator::class)]
  17.     private ?string $id;
  18.     #[ORM\Column]
  19.     private ?float $percentage null;
  20.     #[ORM\Column(typeTypes::BIGINT)]
  21.     private ?string $fixedAmount null;
  22.     #[ORM\Column(typeTypes::DATETIME_MUTABLEnullabletrue)]
  23.     private ?\DateTimeInterface $startDate null;
  24.     #[ORM\Column(typeTypes::DATETIME_MUTABLEnullabletrue)]
  25.     private ?\DateTimeInterface $endDate null;
  26.     #[ORM\ManyToOne(inversedBy'discounts')]
  27.     #[ORM\JoinColumn(nullablefalse)]
  28.     private ?Product $product null;
  29.     #[ORM\ManyToOne(inversedBy'discounts')]
  30.     #[ORM\JoinColumn(nullablefalse)]
  31.     private ?Shop $shop null;
  32.     public function getId(): ?string
  33.     {
  34.         return $this->id;
  35.     }
  36.     public function getPercentage(): ?float
  37.     {
  38.         return $this->percentage;
  39.     }
  40.     public function setPercentage(float $percentage): static
  41.     {
  42.         $this->percentage $percentage;
  43.         return $this;
  44.     }
  45.     public function getFixedAmount(): ?string
  46.     {
  47.         return $this->fixedAmount;
  48.     }
  49.     public function setFixedAmount(string $fixedAmount): static
  50.     {
  51.         $this->fixedAmount $fixedAmount;
  52.         return $this;
  53.     }
  54.     public function getStartDate(): ?\DateTimeInterface
  55.     {
  56.         return $this->startDate;
  57.     }
  58.     public function setStartDate(?\DateTimeInterface $startDate): static
  59.     {
  60.         $this->startDate $startDate;
  61.         return $this;
  62.     }
  63.     public function getEndDate(): ?\DateTimeInterface
  64.     {
  65.         return $this->endDate;
  66.     }
  67.     public function setEndDate(?\DateTimeInterface $endDate): static
  68.     {
  69.         $this->endDate $endDate;
  70.         return $this;
  71.     }
  72.     public function getProduct(): ?Product
  73.     {
  74.         return $this->product;
  75.     }
  76.     public function setProduct(?Product $product): static
  77.     {
  78.         $this->product $product;
  79.         return $this;
  80.     }
  81.     public function getShop(): ?Shop
  82.     {
  83.         return $this->shop;
  84.     }
  85.     public function setShop(?Shop $shop): static
  86.     {
  87.         $this->shop $shop;
  88.         return $this;
  89.     }
  90. }