src/Entity/Gos/ProductVariantMultiDiscount.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Gos;
  3. use Doctrine\ORM\Mapping as ORM;
  4. /**
  5.  * @ORM\Entity(repositoryClass="App\Repository\Gos\ProductVariantMultiDiscountRepository")
  6.  * @ORM\HasLifecycleCallbacks()
  7.  */
  8. class ProductVariantMultiDiscount implements MultiDiscountInterface
  9. {
  10.     /**
  11.      * @ORM\Id()
  12.      * @ORM\GeneratedValue()
  13.      * @ORM\Column(type="integer")
  14.      */
  15.     private $id;
  16.     /**
  17.      * @ORM\Column(type="boolean", nullable=true)
  18.      */
  19.     private $isGross;
  20.     /**
  21.      * @ORM\ManyToOne(targetEntity="App\Entity\Gos\ProductVariantMultiDiscountType", inversedBy="multiDiscounts")
  22.      * @ORM\JoinColumn()
  23.      */
  24.     private $discountType;
  25.     /**
  26.      * @ORM\Column(type="float", precision=10, scale=2)
  27.      */
  28.     private $discount;
  29.     /**
  30.      * @ORM\Column(type="integer")
  31.      */
  32.     private $minAmount;
  33.     /**
  34.      * @ORM\Column(type="integer", nullable=true)
  35.      */
  36.     private $maxAmount;
  37.     /**
  38.      * @ORM\ManyToOne(targetEntity="App\Entity\Gos\ProductVariant", inversedBy="multiDiscount")
  39.      * @ORM\JoinColumn()
  40.      */
  41.     private $productVariant;
  42.     /**
  43.      * @ORM\Column(type="datetime")
  44.      */
  45.     private $createdAt;
  46.     /**
  47.      * @ORM\Column(type="datetime", nullable=true)
  48.      */
  49.     private $updatedAt;
  50.     /**
  51.      * @ORM\PrePersist()
  52.      */
  53.     public function prePersist()
  54.     {
  55.         $this->createdAt = new \DateTime();
  56.     }
  57.     /**
  58.      * @ORM\PreUpdate()
  59.      */
  60.     public function preUpdate()
  61.     {
  62.         $this->updatedAt = new \DateTime();
  63.     }
  64.     public function __toString()
  65.     {
  66.         return (string)$this->id;
  67.     }
  68.     public function getId(): ?int
  69.     {
  70.         return $this->id;
  71.     }
  72.     public function getIsGross(): ?bool
  73.     {
  74.         return $this->isGross;
  75.     }
  76.     public function setIsGross(?bool $isGross): self
  77.     {
  78.         $this->isGross $isGross;
  79.         return $this;
  80.     }
  81.     public function getDiscount(): ?float
  82.     {
  83.         return $this->discount;
  84.     }
  85.     public function setDiscount(float $discount): self
  86.     {
  87.         $this->discount $discount;
  88.         return $this;
  89.     }
  90.     public function getMinAmount(): ?int
  91.     {
  92.         return $this->minAmount;
  93.     }
  94.     public function setMinAmount(int $minAmount): self
  95.     {
  96.         $this->minAmount $minAmount;
  97.         return $this;
  98.     }
  99.     public function getMaxAmount(): ?int
  100.     {
  101.         return $this->maxAmount;
  102.     }
  103.     public function setMaxAmount(?int $maxAmount): self
  104.     {
  105.         $this->maxAmount $maxAmount;
  106.         return $this;
  107.     }
  108.     public function getCreatedAt(): ?\DateTimeInterface
  109.     {
  110.         return $this->createdAt;
  111.     }
  112.     public function setCreatedAt(\DateTimeInterface $createdAt): self
  113.     {
  114.         $this->createdAt $createdAt;
  115.         return $this;
  116.     }
  117.     public function getUpdatedAt(): ?\DateTimeInterface
  118.     {
  119.         return $this->updatedAt;
  120.     }
  121.     public function setUpdatedAt(?\DateTimeInterface $updatedAt): self
  122.     {
  123.         $this->updatedAt $updatedAt;
  124.         return $this;
  125.     }
  126.     public function getDiscountType(): ?ProductVariantMultiDiscountType
  127.     {
  128.         return $this->discountType;
  129.     }
  130.     public function setDiscountType(?ProductVariantMultiDiscountType $discountType): self
  131.     {
  132.         $this->discountType $discountType;
  133.         return $this;
  134.     }
  135.     public function getProductVariant(): ?ProductVariant
  136.     {
  137.         return $this->productVariant;
  138.     }
  139.     public function setProductVariant(?ProductVariant $productVariant): self
  140.     {
  141.         $this->productVariant $productVariant;
  142.         return $this;
  143.     }
  144. }