<?php
namespace App\Entity\Gos;
use Doctrine\ORM\Mapping as ORM;
/**
* OrderCoupon
*
* @ORM\Table(name="order_coupon")
* @ORM\Entity(repositoryClass="App\Repository\OrderCouponRepository")
* @ORM\HasLifecycleCallbacks
*/
class OrderCoupon
{
/**
* @var int
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @var string
*
* @ORM\Column(name="code", type="string", length=255)
*/
private $code;
/**
* @var float
*
* @ORM\Column(name="discount", type="float", nullable=true)
*/
private $discount;
/**
* @var float
*
* @ORM\Column(type="float", nullable=true)
*/
private $discountValue;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $discountDeadline;
/**
* @var float
*
* @ORM\Column(name="gratisPriceNet", type="float", nullable=true)
*/
private $gratisPriceNet;
/**
* @var float
*
* @ORM\Column(name="gratisPriceGross", type="float", nullable=true)
*/
private $gratisPriceGross;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Gos\OrderProductVariant", inversedBy="orderCoupon")
* @ORM\JoinColumn()
*/
private $orderProductVariant;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Gos\CouponType", inversedBy="orderCoupon")
* @ORM\JoinColumn()
*/
private $couponType;
/**
* @ORM\Column(type="datetime")
*/
private $createdAt;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $updatedAt;
/** @ORM\PrePersist() */
public function prePersist()
{
$this->createdAt = new \DateTime();
}
/** @ORM\PreUpdate() */
public function preUpdate()
{
$this->updatedAt = new \DateTime();
}
public function __toString()
{
return (string)$this->code;
}
/**
* Get id
*
* @return int
*/
public function getId()
{
return $this->id;
}
/**
* Set code
*
* @param string $code
*
* @return OrderCoupon
*/
public function setCode($code)
{
$this->code = $code;
return $this;
}
/**
* Get code
*
* @return string
*/
public function getCode()
{
return $this->code;
}
/**
* Set discount
*
* @param integer $discount
*
* @return OrderCoupon
*/
public function setDiscount($discount)
{
$this->discount = $discount;
return $this;
}
/**
* Get discount
*
* @return int
*/
public function getDiscount()
{
return $this->discount;
}
/**
* Set gratisPriceNet
*
* @param float $gratisPriceNet
*
* @return OrderCoupon
*/
public function setGratisPriceNet($gratisPriceNet)
{
$this->gratisPriceNet = $gratisPriceNet;
return $this;
}
/**
* Get gratisPriceNet
*
* @return float
*/
public function getGratisPriceNet()
{
return $this->gratisPriceNet;
}
/**
* Set gratisPriceGross
*
* @param float $gratisPriceGross
*
* @return OrderCoupon
*/
public function setGratisPriceGross($gratisPriceGross)
{
$this->gratisPriceGross = $gratisPriceGross;
return $this;
}
/**
* Get gratisPriceGross
*
* @return float
*/
public function getGratisPriceGross()
{
return $this->gratisPriceGross;
}
/**
* Set createdAt
*
* @param \DateTime $createdAt
*
* @return OrderCoupon
*/
public function setCreatedAt($createdAt)
{
$this->createdAt = $createdAt;
return $this;
}
/**
* Get createdAt
*
* @return \DateTime
*/
public function getCreatedAt()
{
return $this->createdAt;
}
/**
* Set updatedAt
*
* @param \DateTime $updatedAt
*
* @return OrderCoupon
*/
public function setUpdatedAt($updatedAt)
{
$this->updatedAt = $updatedAt;
return $this;
}
/**
* Get updatedAt
*
* @return \DateTime
*/
public function getUpdatedAt()
{
return $this->updatedAt;
}
/**
* Set orderProductVariant
*
* @param \App\Entity\Gos\OrderProductVariant $orderProductVariant
*
* @return OrderCoupon
*/
public function setOrderProductVariant(\App\Entity\Gos\OrderProductVariant $orderProductVariant = null)
{
$this->orderProductVariant = $orderProductVariant;
return $this;
}
/**
* Get orderProductVariant
*
* @return \App\Entity\Gos\OrderProductVariant
*/
public function getOrderProductVariant()
{
return $this->orderProductVariant;
}
/**
* Set couponType
*
* @param \App\Entity\Gos\CouponType $couponType
*
* @return OrderCoupon
*/
public function setCouponType(\App\Entity\Gos\CouponType $couponType = null)
{
$this->couponType = $couponType;
return $this;
}
/**
* Get couponType
*
* @return \App\Entity\Gos\CouponType
*/
public function getCouponType()
{
return $this->couponType;
}
/**
* Set discountValue
*
* @param integer $discountValue
*
* @return OrderCoupon
*/
public function setDiscountValue($discountValue)
{
$this->discountValue = $discountValue;
return $this;
}
/**
* Get discountValue
*
* @return integer
*/
public function getDiscountValue()
{
return $this->discountValue;
}
public function getDiscountDeadline(): ?\DateTimeInterface
{
return $this->discountDeadline;
}
public function setDiscountDeadline(?\DateTimeInterface $discountDeadline): self
{
$this->discountDeadline = $discountDeadline;
return $this;
}
}