<?php
namespace App\Entity\Gos\VirtualCurrency;
use App\Entity\Gos\OrderPart;
use App\Entity\Gos\Orders;
use App\Entity\Gos\User;
use App\Repository\Gos\VirtualCurrency\VirtualCurrencyTransactionRepository;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=VirtualCurrencyTransactionRepository::class)
* @ORM\HasLifecycleCallbacks()
*/
class VirtualCurrencyTransaction
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\ManyToOne(targetEntity=VirtualCurrency::class, inversedBy="virtualCurrencyTransactions")
* @ORM\JoinColumn(nullable=false)
*/
private $virtualCurrency;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $ordTran;
/**
* @ORM\Column(type="float")
*/
private $amount;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $isUnlimited;
/**
* @ORM\Column(type="datetime")
*/
private $createdAt;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $updatedAt;
/**
* @ORM\ManyToOne(targetEntity=User::class, inversedBy="virtualCurrencyTransactions")
* @ORM\JoinColumn(nullable=false)
*/
private $user;
/**
* @ORM\ManyToOne(targetEntity=OrderPart::class, inversedBy="virtualCurrencyTransactions")
*/
private $orderPart;
/**
* @ORM\OneToOne(targetEntity=VirtualCurrencyOrder::class, inversedBy="virtualCurrencyTransaction", cascade={"persist", "remove"})
*/
private $virtualCurrencyOrder;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $validTo;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $used;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $isPaid;
/**
* @ORM\PrePersist()
*/
public function prePersist()
{
$this->createdAt = new \DateTime();
}
/**
* @ORM\PreUpdate()
*/
public function preUpdate()
{
$this->updatedAt = new \DateTime();
}
public function getId(): ?int
{
return $this->id;
}
public function getVirtualCurrency(): ?VirtualCurrency
{
return $this->virtualCurrency;
}
public function setVirtualCurrency(?VirtualCurrency $virtualCurrency): self
{
$this->virtualCurrency = $virtualCurrency;
return $this;
}
public function getOrdTran(): ?string
{
return $this->ordTran;
}
public function setOrdTran(?string $ordTran): self
{
$this->ordTran = $ordTran;
return $this;
}
public function getAmount(): ?float
{
return $this->amount;
}
public function setAmount(float $amount): self
{
$this->amount = $amount;
return $this;
}
/**
* @return mixed
*/
public function getIsUnlimited()
{
return $this->isUnlimited;
}
/**
* @param mixed $isUnlimited
* @return VirtualCurrencyTransaction
*/
public function setIsUnlimited($isUnlimited): VirtualCurrencyTransaction
{
$this->isUnlimited = $isUnlimited;
return $this;
}
public function getCreatedAt(): ?\DateTimeInterface
{
return $this->createdAt;
}
public function getUpdatedAt(): ?\DateTimeInterface
{
return $this->updatedAt;
}
public function getUser(): ?User
{
return $this->user;
}
public function setUser(?User $user): self
{
$this->user = $user;
return $this;
}
public function getOrderPart(): ?OrderPart
{
return $this->orderPart;
}
public function setOrderPart(?OrderPart $orderPart): self
{
$this->orderPart = $orderPart;
return $this;
}
public function getVirtualCurrencyOrder(): ?VirtualCurrencyOrder
{
return $this->virtualCurrencyOrder;
}
public function setVirtualCurrencyOrder(?VirtualCurrencyOrder $virtualCurrencyOrder): self
{
$this->virtualCurrencyOrder = $virtualCurrencyOrder;
return $this;
}
public function getValidTo(): ?\DateTimeInterface
{
return $this->validTo;
}
public function setValidTo(?\DateTimeInterface $validTo): self
{
$this->validTo = $validTo;
return $this;
}
public function getUsed(): ?int
{
return $this->used;
}
public function setUsed(?int $used): self
{
$this->used = $used;
return $this;
}
public function getIsPaid(): ?bool
{
return $this->isPaid;
}
public function setIsPaid(?bool $isPaid): self
{
$this->isPaid = $isPaid;
return $this;
}
}