src/Entity/Gos/CouponType.php line 16

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