<?php
namespace App\Entity\Gos;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass="App\Repository\Gos\GiftRepository")
* @ORM\HasLifecycleCallbacks()
*/
class Gift
{
/**
* @ORM\Id()
* @ORM\GeneratedValue()
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $isActive;
/**
* @ORM\Column(type="string", length=255)
*/
private $recipientFirstName;
/**
* @ORM\Column(type="string", length=255)
*/
private $recipientLastName;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $recipientEmail;
/**
* @ORM\ManyToOne(targetEntity="Orders", inversedBy="buyerGift")
* @ORM\JoinColumn()
*/
private $buyerOrder;
/**
* @ORM\OneToOne(targetEntity="Orders", inversedBy="recipientGift")
* @ORM\JoinColumn()
*/
private $recipientOrder;
/**
* @ORM\OneToOne(targetEntity="Coupon", inversedBy="gift")
* @ORM\JoinColumn()
*/
private $giftDiscountCode;
/**
* @ORM\OneToOne(targetEntity="ProductCart", inversedBy="gift")
* @ORM\JoinColumn(onDelete="SET NULL")
*/
private $productCart;
/**
* @ORM\OneToOne(targetEntity="OrderProductVariant", inversedBy="gift")
* @ORM\JoinColumn(onDelete="SET NULL")
*/
private $orderProductVariant;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $isTemporary;
/**
* @ORM\Column(type="datetime")
*/
private $createdAt;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $updatedAt;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $signature;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $message;
/**
* @ORM\Column(type="date", nullable=true)
*/
private $sendAt;
/**
* @ORM\OneToOne(targetEntity=GiftNotification::class, mappedBy="gift", cascade={"persist", "remove"})
*/
private $giftNotification;
/** @ORM\PrePersist() */
public function prePersist()
{
$this->createdAt = new \DateTime();
}
/** @ORM\PreUpdate() */
public function preUpdate()
{
$this->updatedAt = new \DateTime();
}
public function __toString()
{
return (string) $this->id;
}
public function getId(): ?int
{
return $this->id;
}
public function getIsActive(): ?bool
{
return $this->isActive;
}
public function setIsActive(?bool $isActive): self
{
$this->isActive = $isActive;
return $this;
}
public function getRecipientFirstName(): ?string
{
return $this->recipientFirstName;
}
public function setRecipientFirstName(string $recipientFirstName): self
{
$this->recipientFirstName = $recipientFirstName;
return $this;
}
public function getRecipientLastName(): ?string
{
return $this->recipientLastName;
}
public function setRecipientLastName(string $recipientLastName): self
{
$this->recipientLastName = $recipientLastName;
return $this;
}
public function getRecipientEmail(): ?string
{
return $this->recipientEmail;
}
public function setRecipientEmail(?string $recipientEmail): self
{
$this->recipientEmail = $recipientEmail;
return $this;
}
public function getCreatedAt(): ?\DateTimeInterface
{
return $this->createdAt;
}
public function setCreatedAt(\DateTimeInterface $createdAt): self
{
$this->createdAt = $createdAt;
return $this;
}
public function getUpdatedAt(): ?\DateTimeInterface
{
return $this->updatedAt;
}
public function setUpdatedAt(?\DateTimeInterface $updatedAt): self
{
$this->updatedAt = $updatedAt;
return $this;
}
public function getBuyerOrder(): ?Orders
{
return $this->buyerOrder;
}
public function setBuyerOrder(?Orders $buyerOrder): self
{
$this->buyerOrder = $buyerOrder;
return $this;
}
public function getRecipientOrder(): ?Orders
{
return $this->recipientOrder;
}
public function setRecipientOrder(?Orders $recipientOrder): self
{
$this->recipientOrder = $recipientOrder;
return $this;
}
public function getGiftDiscountCode(): ?Coupon
{
return $this->giftDiscountCode;
}
public function setGiftDiscountCode(?Coupon $giftDiscountCode): self
{
$this->giftDiscountCode = $giftDiscountCode;
return $this;
}
public function getIsTemporary(): ?bool
{
return $this->isTemporary;
}
public function setIsTemporary(?bool $isTemporary): self
{
$this->isTemporary = $isTemporary;
return $this;
}
public function getProductCart(): ?ProductCart
{
return $this->productCart;
}
public function setProductCart(?ProductCart $productCart): self
{
$this->productCart = $productCart;
return $this;
}
public function getOrderProductVariant(): ?OrderProductVariant
{
return $this->orderProductVariant;
}
public function setOrderProductVariant(?OrderProductVariant $orderProductVariant): self
{
$this->orderProductVariant = $orderProductVariant;
return $this;
}
public function getSignature(): ?string
{
return $this->signature;
}
public function setSignature(?string $signature): self
{
$this->signature = $signature;
return $this;
}
public function getMessage(): ?string
{
return $this->message;
}
public function setMessage(?string $message): self
{
$this->message = $message;
return $this;
}
public function getSendAt(): ?\DateTimeInterface
{
return $this->sendAt;
}
public function setSendAt(?\DateTimeInterface $sendAt): self
{
$this->sendAt = $sendAt;
return $this;
}
public function getGiftNotification(): ?GiftNotification
{
return $this->giftNotification;
}
public function setGiftNotification(GiftNotification $giftNotification): self
{
$this->giftNotification = $giftNotification;
// set the owning side of the relation if necessary
if ($giftNotification->getGift() !== $this) {
$giftNotification->setGift($this);
}
return $this;
}
}