src/Entity/Gos/Gift.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Gos;
  3. use Doctrine\Common\Collections\Collection;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6.  * @ORM\Entity(repositoryClass="App\Repository\Gos\GiftRepository")
  7.  * @ORM\HasLifecycleCallbacks()
  8.  */
  9. class Gift
  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.      * @ORM\Column(type="string", length=255)
  23.      */
  24.     private $recipientFirstName;
  25.     /**
  26.      * @ORM\Column(type="string", length=255)
  27.      */
  28.     private $recipientLastName;
  29.     /**
  30.      * @ORM\Column(type="string", length=255, nullable=true)
  31.      */
  32.     private $recipientEmail;
  33.     /**
  34.      * @ORM\ManyToOne(targetEntity="Orders", inversedBy="buyerGift")
  35.      * @ORM\JoinColumn()
  36.      */
  37.     private $buyerOrder;
  38.     /**
  39.      * @ORM\OneToOne(targetEntity="Orders", inversedBy="recipientGift")
  40.      * @ORM\JoinColumn()
  41.      */
  42.     private $recipientOrder;
  43.     /**
  44.      * @ORM\OneToOne(targetEntity="Coupon", inversedBy="gift")
  45.      * @ORM\JoinColumn()
  46.      */
  47.     private $giftDiscountCode;
  48.     /**
  49.      * @ORM\OneToOne(targetEntity="ProductCart", inversedBy="gift")
  50.      * @ORM\JoinColumn(onDelete="SET NULL")
  51.      */
  52.     private $productCart;
  53.     /**
  54.      * @ORM\OneToOne(targetEntity="OrderProductVariant", inversedBy="gift")
  55.      * @ORM\JoinColumn(onDelete="SET NULL")
  56.      */
  57.     private $orderProductVariant;
  58.     /**
  59.      * @ORM\Column(type="boolean", nullable=true)
  60.      */
  61.     private $isTemporary;
  62.     /**
  63.      * @ORM\Column(type="datetime")
  64.      */
  65.     private $createdAt;
  66.     /**
  67.      * @ORM\Column(type="datetime", nullable=true)
  68.      */
  69.     private $updatedAt;
  70.     /**
  71.      * @ORM\Column(type="string", length=255, nullable=true)
  72.      */
  73.     private $signature;
  74.     /**
  75.      * @ORM\Column(type="string", length=255, nullable=true)
  76.      */
  77.     private $message;
  78.     /**
  79.      * @ORM\Column(type="date", nullable=true)
  80.      */
  81.     private $sendAt;
  82.     /**
  83.      * @ORM\OneToOne(targetEntity=GiftNotification::class, mappedBy="gift", cascade={"persist", "remove"})
  84.      */
  85.     private $giftNotification;
  86.     /** @ORM\PrePersist() */
  87.     public function prePersist()
  88.     {
  89.         $this->createdAt = new \DateTime();
  90.     }
  91.     /** @ORM\PreUpdate() */
  92.     public function preUpdate()
  93.     {
  94.         $this->updatedAt = new \DateTime();
  95.     }
  96.     public function __toString()
  97.     {
  98.         return (string) $this->id;
  99.     }
  100.     public function getId(): ?int
  101.     {
  102.         return $this->id;
  103.     }
  104.     public function getIsActive(): ?bool
  105.     {
  106.         return $this->isActive;
  107.     }
  108.     public function setIsActive(?bool $isActive): self
  109.     {
  110.         $this->isActive $isActive;
  111.         return $this;
  112.     }
  113.     public function getRecipientFirstName(): ?string
  114.     {
  115.         return $this->recipientFirstName;
  116.     }
  117.     public function setRecipientFirstName(string $recipientFirstName): self
  118.     {
  119.         $this->recipientFirstName $recipientFirstName;
  120.         return $this;
  121.     }
  122.     public function getRecipientLastName(): ?string
  123.     {
  124.         return $this->recipientLastName;
  125.     }
  126.     public function setRecipientLastName(string $recipientLastName): self
  127.     {
  128.         $this->recipientLastName $recipientLastName;
  129.         return $this;
  130.     }
  131.     public function getRecipientEmail(): ?string
  132.     {
  133.         return $this->recipientEmail;
  134.     }
  135.     public function setRecipientEmail(?string $recipientEmail): self
  136.     {
  137.         $this->recipientEmail $recipientEmail;
  138.         return $this;
  139.     }
  140.     public function getCreatedAt(): ?\DateTimeInterface
  141.     {
  142.         return $this->createdAt;
  143.     }
  144.     public function setCreatedAt(\DateTimeInterface $createdAt): self
  145.     {
  146.         $this->createdAt $createdAt;
  147.         return $this;
  148.     }
  149.     public function getUpdatedAt(): ?\DateTimeInterface
  150.     {
  151.         return $this->updatedAt;
  152.     }
  153.     public function setUpdatedAt(?\DateTimeInterface $updatedAt): self
  154.     {
  155.         $this->updatedAt $updatedAt;
  156.         return $this;
  157.     }
  158.     public function getBuyerOrder(): ?Orders
  159.     {
  160.         return $this->buyerOrder;
  161.     }
  162.     public function setBuyerOrder(?Orders $buyerOrder): self
  163.     {
  164.         $this->buyerOrder $buyerOrder;
  165.         return $this;
  166.     }
  167.     public function getRecipientOrder(): ?Orders
  168.     {
  169.         return $this->recipientOrder;
  170.     }
  171.     public function setRecipientOrder(?Orders $recipientOrder): self
  172.     {
  173.         $this->recipientOrder $recipientOrder;
  174.         return $this;
  175.     }
  176.     public function getGiftDiscountCode(): ?Coupon
  177.     {
  178.         return $this->giftDiscountCode;
  179.     }
  180.     public function setGiftDiscountCode(?Coupon $giftDiscountCode): self
  181.     {
  182.         $this->giftDiscountCode $giftDiscountCode;
  183.         return $this;
  184.     }
  185.     public function getIsTemporary(): ?bool
  186.     {
  187.         return $this->isTemporary;
  188.     }
  189.     public function setIsTemporary(?bool $isTemporary): self
  190.     {
  191.         $this->isTemporary $isTemporary;
  192.         return $this;
  193.     }
  194.     public function getProductCart(): ?ProductCart
  195.     {
  196.         return $this->productCart;
  197.     }
  198.     public function setProductCart(?ProductCart $productCart): self
  199.     {
  200.         $this->productCart $productCart;
  201.         return $this;
  202.     }
  203.     public function getOrderProductVariant(): ?OrderProductVariant
  204.     {
  205.         return $this->orderProductVariant;
  206.     }
  207.     public function setOrderProductVariant(?OrderProductVariant $orderProductVariant): self
  208.     {
  209.         $this->orderProductVariant $orderProductVariant;
  210.         return $this;
  211.     }
  212.     public function getSignature(): ?string
  213.     {
  214.         return $this->signature;
  215.     }
  216.     public function setSignature(?string $signature): self
  217.     {
  218.         $this->signature $signature;
  219.         return $this;
  220.     }
  221.     public function getMessage(): ?string
  222.     {
  223.         return $this->message;
  224.     }
  225.     public function setMessage(?string $message): self
  226.     {
  227.         $this->message $message;
  228.         return $this;
  229.     }
  230.     public function getSendAt(): ?\DateTimeInterface
  231.     {
  232.         return $this->sendAt;
  233.     }
  234.     public function setSendAt(?\DateTimeInterface $sendAt): self
  235.     {
  236.         $this->sendAt $sendAt;
  237.         return $this;
  238.     }
  239.     public function getGiftNotification(): ?GiftNotification
  240.     {
  241.         return $this->giftNotification;
  242.     }
  243.     public function setGiftNotification(GiftNotification $giftNotification): self
  244.     {
  245.         $this->giftNotification $giftNotification;
  246.         // set the owning side of the relation if necessary
  247.         if ($giftNotification->getGift() !== $this) {
  248.             $giftNotification->setGift($this);
  249.         }
  250.         return $this;
  251.     }
  252. }