<?phpnamespace App\Entity\Gos\VirtualCurrency;use App\Entity\Gos\User;use App\Repository\Gos\VirtualCurrency\VirtualCurrencyWalletRepository;use Doctrine\ORM\Mapping as ORM;/** * @ORM\Entity(repositoryClass=VirtualCurrencyWalletRepository::class) * @ORM\HasLifecycleCallbacks() */class VirtualCurrencyWallet{ /** * @ORM\Id * @ORM\GeneratedValue * @ORM\Column(type="integer") */ private $id; /** * @ORM\ManyToOne(targetEntity=VirtualCurrency::class, inversedBy="virtualCurrencyWallets") * @ORM\JoinColumn(nullable=false) */ private $virtualCurrency; /** * @ORM\ManyToOne(targetEntity=User::class, inversedBy="virtualCurrencyWallets") * @ORM\JoinColumn(nullable=false) */ private $user; /** * @ORM\Column(type="float") */ private $balance = 0; /** * @ORM\Column(type="boolean", nullable=true) */ private $isUnlimited; /** * @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 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 getUser(): ?User { return $this->user; } public function setUser(?User $user): self { $this->user = $user; return $this; } public function getBalance(): ?float { return $this->balance; } public function setBalance(float $balance): self { $this->balance = $balance; return $this; } /** * @return bool */ public function getIsUnlimited() { return $this->isUnlimited; } /** * @param mixed $isUnlimited * @return VirtualCurrencyWallet */ public function setIsUnlimited($isUnlimited): VirtualCurrencyWallet { $this->isUnlimited = $isUnlimited; return $this; } public function getCreatedAt(): ?\DateTimeInterface { return $this->createdAt; } public function getUpdatedAt(): ?\DateTimeInterface { return $this->updatedAt; }}