src/Entity/Gos/VirtualCurrency/VirtualCurrencyWallet.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Gos\VirtualCurrency;
  3. use App\Entity\Gos\User;
  4. use App\Repository\Gos\VirtualCurrency\VirtualCurrencyWalletRepository;
  5. use Doctrine\ORM\Mapping as ORM;
  6. /**
  7.  * @ORM\Entity(repositoryClass=VirtualCurrencyWalletRepository::class)
  8.  * @ORM\HasLifecycleCallbacks()
  9.  */
  10. class VirtualCurrencyWallet
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\ManyToOne(targetEntity=VirtualCurrency::class, inversedBy="virtualCurrencyWallets")
  20.      * @ORM\JoinColumn(nullable=false)
  21.      */
  22.     private $virtualCurrency;
  23.     /**
  24.      * @ORM\ManyToOne(targetEntity=User::class, inversedBy="virtualCurrencyWallets")
  25.      * @ORM\JoinColumn(nullable=false)
  26.      */
  27.     private $user;
  28.     /**
  29.      * @ORM\Column(type="float")
  30.      */
  31.     private $balance 0;
  32.     /**
  33.      * @ORM\Column(type="boolean", nullable=true)
  34.      */
  35.     private $isUnlimited;
  36.     /**
  37.      * @ORM\Column(type="datetime")
  38.      */
  39.     private $createdAt;
  40.     /**
  41.      * @ORM\Column(type="datetime", nullable=true)
  42.      */
  43.     private $updatedAt;
  44.     /**
  45.      * @ORM\PrePersist()
  46.      */
  47.     public function prePersist()
  48.     {
  49.         $this->createdAt = new \DateTime();
  50.     }
  51.     /**
  52.      * @ORM\PreUpdate()
  53.      */
  54.     public function preUpdate()
  55.     {
  56.         $this->updatedAt = new \DateTime();
  57.     }
  58.     public function getId(): ?int
  59.     {
  60.         return $this->id;
  61.     }
  62.     public function getVirtualCurrency(): ?VirtualCurrency
  63.     {
  64.         return $this->virtualCurrency;
  65.     }
  66.     public function setVirtualCurrency(?VirtualCurrency $virtualCurrency): self
  67.     {
  68.         $this->virtualCurrency $virtualCurrency;
  69.         return $this;
  70.     }
  71.     public function getUser(): ?User
  72.     {
  73.         return $this->user;
  74.     }
  75.     public function setUser(?User $user): self
  76.     {
  77.         $this->user $user;
  78.         return $this;
  79.     }
  80.     public function getBalance(): ?float
  81.     {
  82.         return $this->balance;
  83.     }
  84.     public function setBalance(float $balance): self
  85.     {
  86.         $this->balance $balance;
  87.         return $this;
  88.     }
  89.     /**
  90.      * @return bool
  91.      */
  92.     public function getIsUnlimited()
  93.     {
  94.         return $this->isUnlimited;
  95.     }
  96.     /**
  97.      * @param mixed $isUnlimited
  98.      * @return VirtualCurrencyWallet
  99.      */
  100.     public function setIsUnlimited($isUnlimited): VirtualCurrencyWallet
  101.     {
  102.         $this->isUnlimited $isUnlimited;
  103.         return $this;
  104.     }
  105.     public function getCreatedAt(): ?\DateTimeInterface
  106.     {
  107.         return $this->createdAt;
  108.     }
  109.     public function getUpdatedAt(): ?\DateTimeInterface
  110.     {
  111.         return $this->updatedAt;
  112.     }
  113. }