<?php
namespace App\Entity\Gos\VirtualCurrency;
use App\Entity\Gos\PortalSettings;
use App\Entity\Gos\User;
use App\Repository\Gos\VirtualCurrency\VirtualCurrencyOrderRepository;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=VirtualCurrencyOrderRepository::class)
* @ORM\HasLifecycleCallbacks()
*/
class VirtualCurrencyOrder
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\ManyToOne(targetEntity=User::class, inversedBy="virtualCurrencyOrders")
* @ORM\JoinColumn(nullable=false)
*/
private $user;
/**
* @ORM\Column(type="string", length=255)
*/
private $ordTran;
/**
* @ORM\Column(type="string", length=255)
*/
private $productVariantNoComplete;
/**
* @ORM\ManyToOne(targetEntity=VirtualCurrency::class, inversedBy="virtualCurrencyOrders")
* @ORM\JoinColumn(nullable=false)
*/
private $virtualCurrency;
/**
* @ORM\Column(type="float")
*/
private $amount;
/**
* @ORM\Column(type="datetime")
*/
private $createdAt;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $updatedAt;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $accessTo;
/**
* @ORM\OneToOne(targetEntity=VirtualCurrencyTransaction::class, mappedBy="virtualCurrencyOrder", cascade={"persist", "remove"})
*/
private $virtualCurrencyTransaction;
/**
* @ORM\ManyToOne(targetEntity=PortalSettings::class)
* @ORM\JoinColumn(nullable=false)
*/
private $portalSettings;
/**
* @ORM\Column(type="string", length=255)
*/
private $title;
/**
* @ORM\PrePersist()
*/
public function prePersist()
{
$this->createdAt = new \DateTime();
}
/**
* @ORM\PreUpdate()
*/
public function preUpdate()
{
$this->updatedAt = new \DateTime();
}
public function getObjectVars()
{
return get_object_vars($this);
}
public function getId(): ?int
{
return $this->id;
}
public function getUser(): ?User
{
return $this->user;
}
public function setUser(?User $user): self
{
$this->user = $user;
return $this;
}
public function getOrdTran(): ?string
{
return $this->ordTran;
}
public function setOrdTran(string $ordTran): self
{
$this->ordTran = $ordTran;
return $this;
}
public function getProductVariantNoComplete(): ?string
{
return $this->productVariantNoComplete;
}
public function setProductVariantNoComplete(string $productVariantNoComplete): self
{
$this->productVariantNoComplete = $productVariantNoComplete;
return $this;
}
public function getVirtualCurrency(): ?VirtualCurrency
{
return $this->virtualCurrency;
}
public function setVirtualCurrency(?VirtualCurrency $virtualCurrency): self
{
$this->virtualCurrency = $virtualCurrency;
return $this;
}
public function getAmount(): ?float
{
return $this->amount;
}
public function setAmount(float $amount): self
{
$this->amount = $amount;
return $this;
}
public function getCreatedAt(): ?\DateTimeInterface
{
return $this->createdAt;
}
public function getUpdatedAt(): ?\DateTimeInterface
{
return $this->updatedAt;
}
public function getAccessTo(): ?\DateTimeInterface
{
return $this->accessTo;
}
public function setAccessTo(?\DateTimeInterface $accessTo): self
{
$this->accessTo = $accessTo;
return $this;
}
public function getVirtualCurrencyTransaction(): ?VirtualCurrencyTransaction
{
return $this->virtualCurrencyTransaction;
}
public function setVirtualCurrencyTransaction(?VirtualCurrencyTransaction $virtualCurrencyTransaction): self
{
$this->virtualCurrencyTransaction = $virtualCurrencyTransaction;
// set (or unset) the owning side of the relation if necessary
$newVirtualCurrencyOrder = null === $virtualCurrencyTransaction ? null : $this;
if ($virtualCurrencyTransaction->getVirtualCurrencyOrder() !== $newVirtualCurrencyOrder) {
$virtualCurrencyTransaction->setVirtualCurrencyOrder($newVirtualCurrencyOrder);
}
return $this;
}
public function getPortalSettings(): ?PortalSettings
{
return $this->portalSettings;
}
public function setPortalSettings(?PortalSettings $portalSettings): self
{
$this->portalSettings = $portalSettings;
return $this;
}
public function getTitle(): ?string
{
return $this->title;
}
public function setTitle(string $title): self
{
$this->title = $title;
return $this;
}
}