src/Entity/Gos/OrderCoupon.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Gos;
  3. use Doctrine\ORM\Mapping as ORM;
  4. /**
  5.  * OrderCoupon
  6.  *
  7.  * @ORM\Table(name="order_coupon")
  8.  * @ORM\Entity(repositoryClass="App\Repository\OrderCouponRepository")
  9.  * @ORM\HasLifecycleCallbacks
  10.  */
  11. class OrderCoupon
  12. {
  13.     /**
  14.      * @var int
  15.      *
  16.      * @ORM\Column(name="id", type="integer")
  17.      * @ORM\Id
  18.      * @ORM\GeneratedValue(strategy="AUTO")
  19.      */
  20.     private $id;
  21.     /**
  22.      * @var string
  23.      *
  24.      * @ORM\Column(name="code", type="string", length=255)
  25.      */
  26.     private $code;
  27.     /**
  28.      * @var float
  29.      *
  30.      * @ORM\Column(name="discount", type="float", nullable=true)
  31.      */
  32.     private $discount;
  33.     /**
  34.      * @var float
  35.      *
  36.      * @ORM\Column(type="float", nullable=true)
  37.      */
  38.     private $discountValue;
  39.     /**
  40.      * @ORM\Column(type="datetime", nullable=true)
  41.      */
  42.     private $discountDeadline;
  43.     /**
  44.      * @var float
  45.      *
  46.      * @ORM\Column(name="gratisPriceNet", type="float", nullable=true)
  47.      */
  48.     private $gratisPriceNet;
  49.     /**
  50.      * @var float
  51.      *
  52.      * @ORM\Column(name="gratisPriceGross", type="float", nullable=true)
  53.      */
  54.     private $gratisPriceGross;
  55.     /**
  56.      * @ORM\ManyToOne(targetEntity="App\Entity\Gos\OrderProductVariant", inversedBy="orderCoupon")
  57.      * @ORM\JoinColumn()
  58.      */
  59.     private $orderProductVariant;
  60.     /**
  61.      * @ORM\ManyToOne(targetEntity="App\Entity\Gos\CouponType", inversedBy="orderCoupon")
  62.      * @ORM\JoinColumn()
  63.      */
  64.     private $couponType;
  65.     /**
  66.      * @ORM\Column(type="datetime")
  67.      */
  68.     private $createdAt;
  69.     /**
  70.      * @ORM\Column(type="datetime", nullable=true)
  71.      */
  72.     private $updatedAt;
  73.     /** @ORM\PrePersist() */
  74.     public function prePersist()
  75.     {
  76.         $this->createdAt = new \DateTime();
  77.     }
  78.     /** @ORM\PreUpdate() */
  79.     public function preUpdate()
  80.     {
  81.         $this->updatedAt = new \DateTime();
  82.     }
  83.     public function __toString()
  84.     {
  85.         return (string)$this->code;
  86.     }
  87.     /**
  88.      * Get id
  89.      *
  90.      * @return int
  91.      */
  92.     public function getId()
  93.     {
  94.         return $this->id;
  95.     }
  96.     /**
  97.      * Set code
  98.      *
  99.      * @param string $code
  100.      *
  101.      * @return OrderCoupon
  102.      */
  103.     public function setCode($code)
  104.     {
  105.         $this->code $code;
  106.         return $this;
  107.     }
  108.     /**
  109.      * Get code
  110.      *
  111.      * @return string
  112.      */
  113.     public function getCode()
  114.     {
  115.         return $this->code;
  116.     }
  117.     /**
  118.      * Set discount
  119.      *
  120.      * @param integer $discount
  121.      *
  122.      * @return OrderCoupon
  123.      */
  124.     public function setDiscount($discount)
  125.     {
  126.         $this->discount $discount;
  127.         return $this;
  128.     }
  129.     /**
  130.      * Get discount
  131.      *
  132.      * @return int
  133.      */
  134.     public function getDiscount()
  135.     {
  136.         return $this->discount;
  137.     }
  138.     /**
  139.      * Set gratisPriceNet
  140.      *
  141.      * @param float $gratisPriceNet
  142.      *
  143.      * @return OrderCoupon
  144.      */
  145.     public function setGratisPriceNet($gratisPriceNet)
  146.     {
  147.         $this->gratisPriceNet $gratisPriceNet;
  148.         return $this;
  149.     }
  150.     /**
  151.      * Get gratisPriceNet
  152.      *
  153.      * @return float
  154.      */
  155.     public function getGratisPriceNet()
  156.     {
  157.         return $this->gratisPriceNet;
  158.     }
  159.     /**
  160.      * Set gratisPriceGross
  161.      *
  162.      * @param float $gratisPriceGross
  163.      *
  164.      * @return OrderCoupon
  165.      */
  166.     public function setGratisPriceGross($gratisPriceGross)
  167.     {
  168.         $this->gratisPriceGross $gratisPriceGross;
  169.         return $this;
  170.     }
  171.     /**
  172.      * Get gratisPriceGross
  173.      *
  174.      * @return float
  175.      */
  176.     public function getGratisPriceGross()
  177.     {
  178.         return $this->gratisPriceGross;
  179.     }
  180.     /**
  181.      * Set createdAt
  182.      *
  183.      * @param \DateTime $createdAt
  184.      *
  185.      * @return OrderCoupon
  186.      */
  187.     public function setCreatedAt($createdAt)
  188.     {
  189.         $this->createdAt $createdAt;
  190.         return $this;
  191.     }
  192.     /**
  193.      * Get createdAt
  194.      *
  195.      * @return \DateTime
  196.      */
  197.     public function getCreatedAt()
  198.     {
  199.         return $this->createdAt;
  200.     }
  201.     /**
  202.      * Set updatedAt
  203.      *
  204.      * @param \DateTime $updatedAt
  205.      *
  206.      * @return OrderCoupon
  207.      */
  208.     public function setUpdatedAt($updatedAt)
  209.     {
  210.         $this->updatedAt $updatedAt;
  211.         return $this;
  212.     }
  213.     /**
  214.      * Get updatedAt
  215.      *
  216.      * @return \DateTime
  217.      */
  218.     public function getUpdatedAt()
  219.     {
  220.         return $this->updatedAt;
  221.     }
  222.     /**
  223.      * Set orderProductVariant
  224.      *
  225.      * @param \App\Entity\Gos\OrderProductVariant $orderProductVariant
  226.      *
  227.      * @return OrderCoupon
  228.      */
  229.     public function setOrderProductVariant(\App\Entity\Gos\OrderProductVariant $orderProductVariant null)
  230.     {
  231.         $this->orderProductVariant $orderProductVariant;
  232.         return $this;
  233.     }
  234.     /**
  235.      * Get orderProductVariant
  236.      *
  237.      * @return \App\Entity\Gos\OrderProductVariant
  238.      */
  239.     public function getOrderProductVariant()
  240.     {
  241.         return $this->orderProductVariant;
  242.     }
  243.     /**
  244.      * Set couponType
  245.      *
  246.      * @param \App\Entity\Gos\CouponType $couponType
  247.      *
  248.      * @return OrderCoupon
  249.      */
  250.     public function setCouponType(\App\Entity\Gos\CouponType $couponType null)
  251.     {
  252.         $this->couponType $couponType;
  253.         return $this;
  254.     }
  255.     /**
  256.      * Get couponType
  257.      *
  258.      * @return \App\Entity\Gos\CouponType
  259.      */
  260.     public function getCouponType()
  261.     {
  262.         return $this->couponType;
  263.     }
  264.     /**
  265.      * Set discountValue
  266.      *
  267.      * @param integer $discountValue
  268.      *
  269.      * @return OrderCoupon
  270.      */
  271.     public function setDiscountValue($discountValue)
  272.     {
  273.         $this->discountValue $discountValue;
  274.         return $this;
  275.     }
  276.     /**
  277.      * Get discountValue
  278.      *
  279.      * @return integer
  280.      */
  281.     public function getDiscountValue()
  282.     {
  283.         return $this->discountValue;
  284.     }
  285.     public function getDiscountDeadline(): ?\DateTimeInterface
  286.     {
  287.         return $this->discountDeadline;
  288.     }
  289.     public function setDiscountDeadline(?\DateTimeInterface $discountDeadline): self
  290.     {
  291.         $this->discountDeadline $discountDeadline;
  292.         return $this;
  293.     }
  294. }