<?phpnamespace App\Entity\Gos;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;/** * CouponType * * @ORM\Table() * @ORM\Entity(repositoryClass="App\Repository\CouponTypeRepository") * @ORM\HasLifecycleCallbacks */class CouponType{ /** * @var int * * @ORM\Column(name="id", type="integer") * @ORM\Id * @ORM\GeneratedValue(strategy="AUTO") */ private $id; /** * @var bool * * @ORM\Column(type="boolean", nullable=true) */ private $isActive; /** * @var string * * @ORM\Column(type="string", length=255) */ private $name; /** * @ORM\OneToMany(targetEntity="App\Entity\Gos\Coupon", mappedBy="couponType") */ private $coupon; /** * @ORM\OneToMany(targetEntity="App\Entity\Gos\ApplicationCoupon", mappedBy="couponType") */ private $applicationCoupon; /** * @ORM\OneToMany(targetEntity="App\Entity\Gos\ArchivedCoupon", mappedBy="couponType") */ private $archivedCoupon; /** * @ORM\OneToMany(targetEntity="App\Entity\Gos\SalesManagoCoupon", mappedBy="couponType") */ private $salesManagoCoupons; /** * @ORM\OneToMany(targetEntity="App\Entity\Gos\OrderCoupon", mappedBy="couponType") */ private $orderCoupon; /** * @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->name; } /** * Constructor */ public function __construct() { $this->coupon = new \Doctrine\Common\Collections\ArrayCollection(); $this->applicationCoupon = new ArrayCollection(); $this->salesManagoCoupons = new \Doctrine\Common\Collections\ArrayCollection(); $this->orderCoupon = new ArrayCollection(); } /** * Get id * * @return int */ public function getId() { return $this->id; } /** * Set isActive * * @param boolean $isActive * * @return CouponType */ public function setIsActive($isActive) { $this->isActive = $isActive; return $this; } /** * Get isActive * * @return bool */ public function getIsActive() { return $this->isActive; } /** * Set name * * @param string $name * * @return CouponType */ public function setName($name) { $this->name = $name; return $this; } /** * Get name * * @return string */ public function getName() { return $this->name; } /** * Set createdAt * * @param \DateTime $createdAt * * @return CouponType */ 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 CouponType */ public function setUpdatedAt($updatedAt) { $this->updatedAt = $updatedAt; return $this; } /** * Get updatedAt * * @return \DateTime */ public function getUpdatedAt() { return $this->updatedAt; } /** * Add coupon * * @param \App\Entity\Gos\Coupon $coupon * * @return CouponType */ public function addCoupon(\App\Entity\Gos\Coupon $coupon) { $this->coupon[] = $coupon; return $this; } /** * Remove coupon * * @param \App\Entity\Gos\Coupon $coupon */ public function removeCoupon(\App\Entity\Gos\Coupon $coupon) { $this->coupon->removeElement($coupon); } /** * Get coupon * * @return \Doctrine\Common\Collections\Collection */ public function getCoupon() { return $this->coupon; } /** * Add applicationCoupon * * @param \App\Entity\Gos\ApplicationCoupon $applicationCoupon * * @return CouponType */ public function addApplicationCoupon(ApplicationCoupon $applicationCoupon) { $this->applicationCoupon[] = $applicationCoupon; return $this; } /** * Remove applicationCoupon * * @param \App\Entity\Gos\ApplicationCoupon $applicationCoupon */ public function removeApplicationCoupon(ApplicationCoupon $applicationCoupon) { $this->applicationCoupon->removeElement($applicationCoupon); } /** * Get applicationCoupon * * @return \Doctrine\Common\Collections\Collection */ public function getApplicationCoupon() { return $this->applicationCoupon; } /** * Add salesManagoCoupon * * @param \App\Entity\Gos\SalesManagoCoupon $salesManagoCoupon * * @return CouponType */ public function addSalesManagoCoupon(\App\Entity\Gos\SalesManagoCoupon $salesManagoCoupon) { $this->salesManagoCoupons[] = $salesManagoCoupon; return $this; } /** * Remove salesManagoCoupon * * @param \App\Entity\Gos\SalesManagoCoupon $salesManagoCoupon */ public function removeSalesManagoCoupon(\App\Entity\Gos\SalesManagoCoupon $salesManagoCoupon) { $this->salesManagoCoupons->removeElement($salesManagoCoupon); } /** * Get salesManagoCoupons * * @return \Doctrine\Common\Collections\Collection */ public function getSalesManagoCoupons() { return $this->salesManagoCoupons; } /** * Add orderCoupon * * @param \App\Entity\Gos\OrderCoupon $orderCoupon * * @return CouponType */ public function addOrderCoupon(\App\Entity\Gos\OrderCoupon $orderCoupon) { $this->orderCoupon[] = $orderCoupon; return $this; } /** * Remove orderCoupon * * @param \App\Entity\Gos\OrderCoupon $orderCoupon */ public function removeOrderCoupon(\App\Entity\Gos\OrderCoupon $orderCoupon) { $this->orderCoupon->removeElement($orderCoupon); } /** * Get orderCoupon * * @return \Doctrine\Common\Collections\Collection */ public function getOrderCoupon() { return $this->orderCoupon; }}