<?php
namespace App\Entity\Gos;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass="App\Repository\Gos\ApplicationCouponRepository")
* @ORM\HasLifecycleCallbacks
*/
class ApplicationCoupon
{
/**
* @ORM\Id()
* @ORM\GeneratedValue()
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $isActive;
/**
* @var bool
*
* @ORM\Column(type="boolean", nullable=true)
*/
private $isGross;
/**
* @ORM\Column(type="float", precision=10, scale=2, nullable=true)
*/
protected $discount;
/**
* @ORM\Column(type="string", length=255)
*/
private $name;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $description;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $successMessage;
/**
* @ORM\Column(type="integer", nullable=false)
*/
private $hours;
/**
* @ORM\Column(type="datetime")
*/
private $createdAt;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $updatedAt;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $isProgrammingRule;
/**
* @ORM\Column(type="string", nullable=true)
*/
private $couponRuleId;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $couponRuleDescription;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Gos\CouponType", inversedBy="applicationCoupon")
*/
protected $couponType;
/**
* @ORM\ManyToMany(targetEntity="App\Entity\Gos\ProductVariant", inversedBy="applicationCoupon")
* @ORM\JoinTable(name="product_variant_application_coupon")
*/
private $productVariant;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Gos\BaseCoupon", mappedBy="applicationCoupon")
*/
protected $coupon;
/** @ORM\PrePersist() */
public function prePersist()
{
$this->createdAt = new \DateTime();
}
/** @ORM\PreUpdate() */
public function preUpdate()
{
$this->updatedAt = new \DateTime();
}
public function __construct()
{
$this->coupon = new ArrayCollection();
$this->productVariant = new ArrayCollection();
}
/**
* @return int|null
*/
public function getId(): ?int
{
return $this->id;
}
/**
* @return bool
*/
public function isGross(): ?bool
{
return $this->isGross;
}
/**
* @param bool $isGross
*/
public function setIsGross(bool $isGross): void
{
$this->isGross = $isGross;
}
/**
* @return mixed
*/
public function getDiscount()
{
return $this->discount;
}
/**
* @param mixed $discount
*/
public function setDiscount($discount): void
{
$this->discount = $discount;
}
/**
* @return bool|null
*/
public function getIsActive(): ?bool
{
return $this->isActive;
}
/**
* @param bool|null $isActive
* @return ApplicationCoupon
*/
public function setIsActive(?bool $isActive): self
{
$this->isActive = $isActive;
return $this;
}
/**
* @return null|string
*/
public function getName(): ?string
{
return $this->name;
}
/**
* @param string $name
* @return ApplicationCoupon
*/
public function setName(string $name): self
{
$this->name = $name;
return $this;
}
/**
* @return null|string
*/
public function getDescription(): ?string
{
return $this->description;
}
/**
* @param string $description
* @return ApplicationCoupon
*/
public function setDescription(string $description): self
{
$this->description = $description;
return $this;
}
/**
* @return mixed
*/
public function getSuccessMessage()
{
return $this->successMessage;
}
/**
* @param mixed $successMessage
* @return ApplicationCoupon
*/
public function setSuccessMessage($successMessage): self
{
$this->successMessage = $successMessage;
return $this;
}
/**
* @return \DateTimeInterface|null
*/
public function getCreatedAt(): ?\DateTimeInterface
{
return $this->createdAt;
}
/**
* @param \DateTimeInterface $createdAt
* @return ApplicationCoupon
*/
public function setCreatedAt(\DateTimeInterface $createdAt): self
{
$this->createdAt = $createdAt;
return $this;
}
/**
* @return \DateTimeInterface|null
*/
public function getUpdatedAt(): ?\DateTimeInterface
{
return $this->updatedAt;
}
/**
* @param \DateTimeInterface $updatedAt
* @return ApplicationCoupon
*/
public function setUpdatedAt(\DateTimeInterface $updatedAt): self
{
$this->updatedAt = $updatedAt;
return $this;
}
/**
* @return mixed
*/
public function getHours()
{
return $this->hours;
}
/**
* @param mixed $hours
*/
public function setHours($hours): void
{
$this->hours = $hours;
}
/**
* @return mixed
*/
public function getIsProgrammingRule()
{
return $this->isProgrammingRule;
}
/**
* @param mixed $isProgrammingRule
*/
public function setIsProgrammingRule($isProgrammingRule): void
{
$this->isProgrammingRule = $isProgrammingRule;
}
/**
* @return mixed
*/
public function getCouponRuleId()
{
return $this->couponRuleId;
}
/**
* @param mixed $couponRuleId
*/
public function setCouponRuleId($couponRuleId): void
{
$this->couponRuleId = $couponRuleId;
}
/**
* @return mixed
*/
public function getCouponRuleDescription()
{
return $this->couponRuleDescription;
}
/**
* @param mixed $couponRuleDescription
*/
public function setCouponRuleDescription($couponRuleDescription): void
{
$this->couponRuleDescription = $couponRuleDescription;
}
/**
* Set couponType
*
* @param \App\Entity\Gos\CouponType $couponType
*
* @return ApplicationCoupon
*/
public function setCouponType(CouponType $couponType = null)
{
$this->couponType = $couponType;
return $this;
}
/**
* Get couponType
*
* @return \App\Entity\Gos\CouponType
*/
public function getCouponType()
{
return $this->couponType;
}
/**
* Add productVariant
*
* @param \App\Entity\Gos\ProductVariant $productVariant
*
* @return ApplicationCoupon
*/
public function addProductVariant(ProductVariant $productVariant)
{
$this->productVariant[] = $productVariant;
return $this;
}
/**
* Remove productVariant
*
* @param \App\Entity\Gos\ProductVariant $productVariant
*/
public function removeProductVariant(ProductVariant $productVariant)
{
$this->productVariant->removeElement($productVariant);
}
/**
* Get productVariant
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getProductVariant()
{
return $this->productVariant;
}
/**
* Add coupon
*
* @param \App\Entity\Gos\Coupon $coupon
*
* @return ApplicationCoupon
*/
public function addCoupon(Coupon $coupon)
{
$this->coupon[] = $coupon;
return $this;
}
/**
* Remove coupon
*
* @param \App\Entity\Gos\Coupon $coupon
*/
public function removeCoupon(Coupon $coupon)
{
$this->coupon->removeElement($coupon);
}
/**
* Get coupon
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getCoupon()
{
return $this->coupon;
}
}