<?phpnamespace App\Entity\Gos\VirtualCurrency;use App\Entity\Gos\PortalSettings;use App\Entity\Gos\ProductVariant;use App\Repository\Gos\VirtualCurrency\VirtualCurrencyRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;/** * @ORM\Entity(repositoryClass=VirtualCurrencyRepository::class) * @ORM\HasLifecycleCallbacks() */class VirtualCurrency{ /** * @ORM\Id * @ORM\GeneratedValue * @ORM\Column(type="integer") */ private $id; /** * @ORM\Column(type="string", length=255) */ private $name; /** * @ORM\Column(type="datetime") */ private $createdAt; /** * @ORM\Column(type="datetime", nullable=true) */ private $updatedAt; /** * @ORM\OneToMany(targetEntity=VirtualCurrencyWallet::class, mappedBy="virtualCurrency") */ private $virtualCurrencyWallets; /** * @ORM\OneToMany(targetEntity=VirtualCurrencyTransaction::class, mappedBy="virtualCurrency") */ private $virtualCurrencyTransactions; /** * @ORM\OneToMany(targetEntity=VirtualCurrencyOrder::class, mappedBy="virtualCurrency") */ private $virtualCurrencyOrders; /** * @ORM\OneToMany(targetEntity=PortalSettings::class, mappedBy="virtualCurrency") */ private $portalSettings; public function __construct() { $this->virtualCurrencyWallets = new ArrayCollection(); $this->virtualCurrencyTransactions = new ArrayCollection(); $this->virtualCurrencyOrders = new ArrayCollection(); $this->portalSettings = new ArrayCollection(); } public function __toString() { return $this->name; } /** * @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 getName(): ?string { return $this->name; } public function setName(string $name): self { $this->name = $name; return $this; } public function getCreatedAt(): ?\DateTimeInterface { return $this->createdAt; } public function getUpdatedAt(): ?\DateTimeInterface { return $this->updatedAt; } /** * @return Collection|VirtualCurrencyWallet[] */ public function getVirtualCurrencyWallets(): Collection { return $this->virtualCurrencyWallets; } public function addVirtualCurrencyWallet(VirtualCurrencyWallet $virtualCurrencyWallet): self { if (!$this->virtualCurrencyWallets->contains($virtualCurrencyWallet)) { $this->virtualCurrencyWallets[] = $virtualCurrencyWallet; $virtualCurrencyWallet->setVirtualCurrency($this); } return $this; } public function removeVirtualCurrencyWallet(VirtualCurrencyWallet $virtualCurrencyWallet): self { if ($this->virtualCurrencyWallets->contains($virtualCurrencyWallet)) { $this->virtualCurrencyWallets->removeElement($virtualCurrencyWallet); // set the owning side to null (unless already changed) if ($virtualCurrencyWallet->getVirtualCurrency() === $this) { $virtualCurrencyWallet->setVirtualCurrency(null); } } return $this; } /** * @return Collection|VirtualCurrencyTransaction[] */ public function getVirtualCurrencyTransactions(): Collection { return $this->virtualCurrencyTransactions; } public function addVirtualCurrencyTransaction(VirtualCurrencyTransaction $virtualCurrencyTransaction): self { if (!$this->virtualCurrencyTransactions->contains($virtualCurrencyTransaction)) { $this->virtualCurrencyTransactions[] = $virtualCurrencyTransaction; $virtualCurrencyTransaction->setVirtualCurrency($this); } return $this; } public function removeVirtualCurrencyTransaction(VirtualCurrencyTransaction $virtualCurrencyTransaction): self { if ($this->virtualCurrencyTransactions->contains($virtualCurrencyTransaction)) { $this->virtualCurrencyTransactions->removeElement($virtualCurrencyTransaction); // set the owning side to null (unless already changed) if ($virtualCurrencyTransaction->getVirtualCurrency() === $this) { $virtualCurrencyTransaction->setVirtualCurrency(null); } } return $this; } /** * @return Collection|VirtualCurrencyOrder[] */ public function getVirtualCurrencyOrders(): Collection { return $this->virtualCurrencyOrders; } public function addVirtualCurrencyOrder(VirtualCurrencyOrder $virtualCurrencyOrder): self { if (!$this->virtualCurrencyOrders->contains($virtualCurrencyOrder)) { $this->virtualCurrencyOrders[] = $virtualCurrencyOrder; $virtualCurrencyOrder->setVirtualCurrency($this); } return $this; } public function removeVirtualCurrencyOrder(VirtualCurrencyOrder $virtualCurrencyOrder): self { if ($this->virtualCurrencyOrders->contains($virtualCurrencyOrder)) { $this->virtualCurrencyOrders->removeElement($virtualCurrencyOrder); // set the owning side to null (unless already changed) if ($virtualCurrencyOrder->getVirtualCurrency() === $this) { $virtualCurrencyOrder->setVirtualCurrency(null); } } return $this; } /** * @return Collection|PortalSettings[] */ public function getPortalSettings(): Collection { return $this->portalSettings; } public function addPortalSetting(PortalSettings $portalSetting): self { if (!$this->portalSettings->contains($portalSetting)) { $this->portalSettings[] = $portalSetting; $portalSetting->setVirtualCurrency($this); } return $this; } public function removePortalSetting(PortalSettings $portalSetting): self { if ($this->portalSettings->contains($portalSetting)) { $this->portalSettings->removeElement($portalSetting); // set the owning side to null (unless already changed) if ($portalSetting->getVirtualCurrency() === $this) { $portalSetting->setVirtualCurrency(null); } } return $this; }}