src/Entity/Gos/ApplicationCoupon.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Gos;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6.  * @ORM\Entity(repositoryClass="App\Repository\Gos\ApplicationCouponRepository")
  7.  * @ORM\HasLifecycleCallbacks
  8.  */
  9. class ApplicationCoupon
  10. {
  11.     /**
  12.      * @ORM\Id()
  13.      * @ORM\GeneratedValue()
  14.      * @ORM\Column(type="integer")
  15.      */
  16.     private $id;
  17.     /**
  18.      * @ORM\Column(type="boolean", nullable=true)
  19.      */
  20.     private $isActive;
  21.     /**
  22.      * @var bool
  23.      *
  24.      * @ORM\Column(type="boolean", nullable=true)
  25.      */
  26.     private $isGross;
  27.     /**
  28.      * @ORM\Column(type="float", precision=10, scale=2, nullable=true)
  29.      */
  30.     protected $discount;
  31.     /**
  32.      * @ORM\Column(type="string", length=255)
  33.      */
  34.     private $name;
  35.     /**
  36.      * @ORM\Column(type="text", nullable=true)
  37.      */
  38.     private $description;
  39.     /**
  40.      * @ORM\Column(type="text", nullable=true)
  41.      */
  42.     private $successMessage;
  43.     /**
  44.      * @ORM\Column(type="integer", nullable=false)
  45.      */
  46.     private $hours;
  47.     /**
  48.      * @ORM\Column(type="datetime")
  49.      */
  50.     private $createdAt;
  51.     /**
  52.      * @ORM\Column(type="datetime", nullable=true)
  53.      */
  54.     private $updatedAt;
  55.     /**
  56.      * @ORM\Column(type="boolean", nullable=true)
  57.      */
  58.     private $isProgrammingRule;
  59.     /**
  60.      * @ORM\Column(type="string", nullable=true)
  61.      */
  62.     private $couponRuleId;
  63.     /**
  64.      * @ORM\Column(type="text", nullable=true)
  65.      */
  66.     private $couponRuleDescription;
  67.     /**
  68.      * @ORM\ManyToOne(targetEntity="App\Entity\Gos\CouponType", inversedBy="applicationCoupon")
  69.      */
  70.     protected $couponType;
  71.     /**
  72.      * @ORM\ManyToMany(targetEntity="App\Entity\Gos\ProductVariant", inversedBy="applicationCoupon")
  73.      * @ORM\JoinTable(name="product_variant_application_coupon")
  74.      */
  75.     private $productVariant;
  76.     /**
  77.      * @ORM\OneToMany(targetEntity="App\Entity\Gos\BaseCoupon", mappedBy="applicationCoupon")
  78.      */
  79.     protected $coupon;
  80.     /** @ORM\PrePersist() */
  81.     public function prePersist()
  82.     {
  83.         $this->createdAt = new \DateTime();
  84.     }
  85.     /** @ORM\PreUpdate() */
  86.     public function preUpdate()
  87.     {
  88.         $this->updatedAt = new \DateTime();
  89.     }
  90.     public function __construct()
  91.     {
  92.         $this->coupon         = new ArrayCollection();
  93.         $this->productVariant = new ArrayCollection();
  94.     }
  95.     /**
  96.      * @return int|null
  97.      */
  98.     public function getId(): ?int
  99.     {
  100.         return $this->id;
  101.     }
  102.     /**
  103.      * @return bool
  104.      */
  105.     public function isGross(): ?bool
  106.     {
  107.         return $this->isGross;
  108.     }
  109.     /**
  110.      * @param bool $isGross
  111.      */
  112.     public function setIsGross(bool $isGross): void
  113.     {
  114.         $this->isGross $isGross;
  115.     }
  116.     /**
  117.      * @return mixed
  118.      */
  119.     public function getDiscount()
  120.     {
  121.         return $this->discount;
  122.     }
  123.     /**
  124.      * @param mixed $discount
  125.      */
  126.     public function setDiscount($discount): void
  127.     {
  128.         $this->discount $discount;
  129.     }
  130.     /**
  131.      * @return bool|null
  132.      */
  133.     public function getIsActive(): ?bool
  134.     {
  135.         return $this->isActive;
  136.     }
  137.     /**
  138.      * @param bool|null $isActive
  139.      * @return ApplicationCoupon
  140.      */
  141.     public function setIsActive(?bool $isActive): self
  142.     {
  143.         $this->isActive $isActive;
  144.         return $this;
  145.     }
  146.     /**
  147.      * @return null|string
  148.      */
  149.     public function getName(): ?string
  150.     {
  151.         return $this->name;
  152.     }
  153.     /**
  154.      * @param string $name
  155.      * @return ApplicationCoupon
  156.      */
  157.     public function setName(string $name): self
  158.     {
  159.         $this->name $name;
  160.         return $this;
  161.     }
  162.     /**
  163.      * @return null|string
  164.      */
  165.     public function getDescription(): ?string
  166.     {
  167.         return $this->description;
  168.     }
  169.     /**
  170.      * @param string $description
  171.      * @return ApplicationCoupon
  172.      */
  173.     public function setDescription(string $description): self
  174.     {
  175.         $this->description $description;
  176.         return $this;
  177.     }
  178.     /**
  179.      * @return mixed
  180.      */
  181.     public function getSuccessMessage()
  182.     {
  183.         return $this->successMessage;
  184.     }
  185.     /**
  186.      * @param mixed $successMessage
  187.      * @return ApplicationCoupon
  188.      */
  189.     public function setSuccessMessage($successMessage): self
  190.     {
  191.         $this->successMessage $successMessage;
  192.         return $this;
  193.     }
  194.     /**
  195.      * @return \DateTimeInterface|null
  196.      */
  197.     public function getCreatedAt(): ?\DateTimeInterface
  198.     {
  199.         return $this->createdAt;
  200.     }
  201.     /**
  202.      * @param \DateTimeInterface $createdAt
  203.      * @return ApplicationCoupon
  204.      */
  205.     public function setCreatedAt(\DateTimeInterface $createdAt): self
  206.     {
  207.         $this->createdAt $createdAt;
  208.         return $this;
  209.     }
  210.     /**
  211.      * @return \DateTimeInterface|null
  212.      */
  213.     public function getUpdatedAt(): ?\DateTimeInterface
  214.     {
  215.         return $this->updatedAt;
  216.     }
  217.     /**
  218.      * @param \DateTimeInterface $updatedAt
  219.      * @return ApplicationCoupon
  220.      */
  221.     public function setUpdatedAt(\DateTimeInterface $updatedAt): self
  222.     {
  223.         $this->updatedAt $updatedAt;
  224.         return $this;
  225.     }
  226.     /**
  227.      * @return mixed
  228.      */
  229.     public function getHours()
  230.     {
  231.         return $this->hours;
  232.     }
  233.     /**
  234.      * @param mixed $hours
  235.      */
  236.     public function setHours($hours): void
  237.     {
  238.         $this->hours $hours;
  239.     }
  240.     /**
  241.      * @return mixed
  242.      */
  243.     public function getIsProgrammingRule()
  244.     {
  245.         return $this->isProgrammingRule;
  246.     }
  247.     /**
  248.      * @param mixed $isProgrammingRule
  249.      */
  250.     public function setIsProgrammingRule($isProgrammingRule): void
  251.     {
  252.         $this->isProgrammingRule $isProgrammingRule;
  253.     }
  254.     /**
  255.      * @return mixed
  256.      */
  257.     public function getCouponRuleId()
  258.     {
  259.         return $this->couponRuleId;
  260.     }
  261.     /**
  262.      * @param mixed $couponRuleId
  263.      */
  264.     public function setCouponRuleId($couponRuleId): void
  265.     {
  266.         $this->couponRuleId $couponRuleId;
  267.     }
  268.     /**
  269.      * @return mixed
  270.      */
  271.     public function getCouponRuleDescription()
  272.     {
  273.         return $this->couponRuleDescription;
  274.     }
  275.     /**
  276.      * @param mixed $couponRuleDescription
  277.      */
  278.     public function setCouponRuleDescription($couponRuleDescription): void
  279.     {
  280.         $this->couponRuleDescription $couponRuleDescription;
  281.     }
  282.     /**
  283.      * Set couponType
  284.      *
  285.      * @param \App\Entity\Gos\CouponType $couponType
  286.      *
  287.      * @return ApplicationCoupon
  288.      */
  289.     public function setCouponType(CouponType $couponType null)
  290.     {
  291.         $this->couponType $couponType;
  292.         return $this;
  293.     }
  294.     /**
  295.      * Get couponType
  296.      *
  297.      * @return \App\Entity\Gos\CouponType
  298.      */
  299.     public function getCouponType()
  300.     {
  301.         return $this->couponType;
  302.     }
  303.     /**
  304.      * Add productVariant
  305.      *
  306.      * @param \App\Entity\Gos\ProductVariant $productVariant
  307.      *
  308.      * @return ApplicationCoupon
  309.      */
  310.     public function addProductVariant(ProductVariant $productVariant)
  311.     {
  312.         $this->productVariant[] = $productVariant;
  313.         return $this;
  314.     }
  315.     /**
  316.      * Remove productVariant
  317.      *
  318.      * @param \App\Entity\Gos\ProductVariant $productVariant
  319.      */
  320.     public function removeProductVariant(ProductVariant $productVariant)
  321.     {
  322.         $this->productVariant->removeElement($productVariant);
  323.     }
  324.     /**
  325.      * Get productVariant
  326.      *
  327.      * @return \Doctrine\Common\Collections\Collection
  328.      */
  329.     public function getProductVariant()
  330.     {
  331.         return $this->productVariant;
  332.     }
  333.     /**
  334.      * Add coupon
  335.      *
  336.      * @param \App\Entity\Gos\Coupon $coupon
  337.      *
  338.      * @return ApplicationCoupon
  339.      */
  340.     public function addCoupon(Coupon $coupon)
  341.     {
  342.         $this->coupon[] = $coupon;
  343.         return $this;
  344.     }
  345.     /**
  346.      * Remove coupon
  347.      *
  348.      * @param \App\Entity\Gos\Coupon $coupon
  349.      */
  350.     public function removeCoupon(Coupon $coupon)
  351.     {
  352.         $this->coupon->removeElement($coupon);
  353.     }
  354.     /**
  355.      * Get coupon
  356.      *
  357.      * @return \Doctrine\Common\Collections\Collection
  358.      */
  359.     public function getCoupon()
  360.     {
  361.         return $this->coupon;
  362.     }
  363. }