src/Entity/Telegram/AgentPublicBot/BotUser.php line 17

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Telegram\AgentPublicBot;
  3. use App\Entity\BaseEntity;
  4. use App\Entity\SubTransactions\ArzDigital;
  5. use App\Entity\VPN\Service\Service;
  6. use App\Repository\Telegram\AgentPublicBot\BotUserRepository;
  7. use Doctrine\Common\Collections\ArrayCollection;
  8. use Doctrine\Common\Collections\Collection;
  9. use Doctrine\DBAL\Types\Types;
  10. use Doctrine\ORM\Mapping as ORM;
  11. use Symfony\Bridge\Doctrine\IdGenerator\UuidGenerator;
  12. #[ORM\Table(name'`agent_public_bot_user`')]
  13. #[ORM\Entity(repositoryClassBotUserRepository::class)]
  14. class BotUser extends BaseEntity
  15. {
  16.     #[ORM\Id]
  17.     #[ORM\Column(type'guid'uniquetrue)]
  18.     #[ORM\GeneratedValue(strategy'CUSTOM')]
  19.     #[ORM\CustomIdGenerator(class: UuidGenerator::class)]
  20.     private ?string $id null;
  21.     #[ORM\Column(length255nullabletrue)]
  22.     private ?string $name null;
  23.     #[ORM\Column(length255nullabletrue)]
  24.     private ?string $username null;
  25.     #[ORM\Column(typeTypes::BIGINTnullabletrue)]
  26.     private ?string $userId null;
  27.     #[ORM\Column]
  28.     private ?int $wallet null;
  29.     #[ORM\Column]
  30.     private ?bool $havePendingPayment null;
  31.     #[ORM\Column(length255nullabletrue)]
  32.     private ?string $step null;
  33.     #[ORM\ManyToOne(inversedBy'botUsers')]
  34.     #[ORM\JoinColumn(nullablefalse)]
  35.     private ?Bot $bot null;
  36.     #[ORM\OneToMany(mappedBy'botUser'targetEntityBotTransaction::class)]
  37.     private Collection $botTransactions;
  38.     #[ORM\Column(nullabletrue)]
  39.     private ?array $newServiceDetail null;
  40.     #[ORM\OneToMany(mappedBy'botUser'targetEntityService::class)]
  41.     private Collection $services;
  42.     #[ORM\ManyToOne(inversedBy'botUsers')]
  43.     private ?BotCampaign $campaign null;
  44.     #[ORM\OneToMany(mappedBy'botUserOwner'targetEntityArzDigital::class)]
  45.     private Collection $arzDigitals;
  46.     #[ORM\Column]
  47.     private ?bool $gotTest null;
  48.     public function __construct()
  49.     {
  50.         parent::__construct();
  51.         $this->wallet =;
  52.         $this->havePendingPayment 0;
  53.         $this->botTransactions = new ArrayCollection();
  54.         $this->services = new ArrayCollection();
  55.         $this->arzDigitals = new ArrayCollection();
  56.         $this->setGotTest(0);
  57.     }
  58.     public function getBotId()
  59.     {
  60.         return $this->getBot()->getId();
  61.     }
  62.     public function getId(): ?string
  63.     {
  64.         return $this->id;
  65.     }
  66.     public function getName(): ?string
  67.     {
  68.         return $this->name;
  69.     }
  70.     public function setName(?string $name): static
  71.     {
  72.         $this->name $name;
  73.         return $this;
  74.     }
  75.     public function getUsername(): ?string
  76.     {
  77.         return $this->username;
  78.     }
  79.     public function setUsername(?string $username): static
  80.     {
  81.         $this->username $username;
  82.         return $this;
  83.     }
  84.     public function getUserId(): ?string
  85.     {
  86.         return $this->userId;
  87.     }
  88.     public function setUserId(?string $userId): static
  89.     {
  90.         $this->userId $userId;
  91.         return $this;
  92.     }
  93.     public function getWallet(): ?int
  94.     {
  95.         return $this->wallet;
  96.     }
  97.     public function setWallet(int $wallet): static
  98.     {
  99.         $this->wallet $wallet;
  100.         return $this;
  101.     }
  102.     public function isHavePendingPayment(): ?bool
  103.     {
  104.         return $this->havePendingPayment;
  105.     }
  106.     public function setHavePendingPayment(bool $havePendingPayment): static
  107.     {
  108.         $this->havePendingPayment $havePendingPayment;
  109.         return $this;
  110.     }
  111.     public function getStep(): ?string
  112.     {
  113.         return $this->step;
  114.     }
  115.     public function setStep(?string $step): static
  116.     {
  117.         $this->step $step;
  118.         return $this;
  119.     }
  120.     public function getBot(): ?Bot
  121.     {
  122.         return $this->bot;
  123.     }
  124.     public function setBot(?Bot $bot): static
  125.     {
  126.         $this->bot $bot;
  127.         return $this;
  128.     }
  129.     /**
  130.      * @return Collection<int, BotTransaction>
  131.      */
  132.     public function getBotTransactions(): Collection
  133.     {
  134.         return $this->botTransactions;
  135.     }
  136.     public function addBotTransaction(BotTransaction $botTransaction): static
  137.     {
  138.         if (!$this->botTransactions->contains($botTransaction)) {
  139.             $this->botTransactions->add($botTransaction);
  140.             $botTransaction->setBotUser($this);
  141.         }
  142.         return $this;
  143.     }
  144.     public function removeBotTransaction(BotTransaction $botTransaction): static
  145.     {
  146.         if ($this->botTransactions->removeElement($botTransaction)) {
  147.             // set the owning side to null (unless already changed)
  148.             if ($botTransaction->getBotUser() === $this) {
  149.                 $botTransaction->setBotUser(null);
  150.             }
  151.         }
  152.         return $this;
  153.     }
  154.     public function &getNewServiceDetail(): ?array
  155.     {
  156.         return $this->newServiceDetail;
  157.     }
  158.     public function setNewServiceDetail(?array $newServiceDetail): static
  159.     {
  160.         $this->newServiceDetail $newServiceDetail;
  161.         return $this;
  162.     }
  163.     /**
  164.      * @return Collection<int, Service>
  165.      */
  166.     public function getServices(): Collection
  167.     {
  168.         return $this->services;
  169.     }
  170.     public function addService(Service $service): static
  171.     {
  172.         if (!$this->services->contains($service)) {
  173.             $this->services->add($service);
  174.             $service->setBotUser($this);
  175.         }
  176.         return $this;
  177.     }
  178.     public function removeService(Service $service): static
  179.     {
  180.         if ($this->services->removeElement($service)) {
  181.             // set the owning side to null (unless already changed)
  182.             if ($service->getBotUser() === $this) {
  183.                 $service->setBotUser(null);
  184.             }
  185.         }
  186.         return $this;
  187.     }
  188.     public function getCampaign(): ?BotCampaign
  189.     {
  190.         return $this->campaign;
  191.     }
  192.     public function setCampaign(?BotCampaign $campaign): static
  193.     {
  194.         $this->campaign $campaign;
  195.         return $this;
  196.     }
  197.     /**
  198.      * @return Collection<int, ArzDigital>
  199.      */
  200.     public function getArzDigitals(): Collection
  201.     {
  202.         return $this->arzDigitals;
  203.     }
  204.     public function addArzDigital(ArzDigital $arzDigital): static
  205.     {
  206.         if (!$this->arzDigitals->contains($arzDigital)) {
  207.             $this->arzDigitals->add($arzDigital);
  208.             $arzDigital->setBotUserOwner($this);
  209.         }
  210.         return $this;
  211.     }
  212.     public function removeArzDigital(ArzDigital $arzDigital): static
  213.     {
  214.         if ($this->arzDigitals->removeElement($arzDigital)) {
  215.             // set the owning side to null (unless already changed)
  216.             if ($arzDigital->getBotUserOwner() === $this) {
  217.                 $arzDigital->setBotUserOwner(null);
  218.             }
  219.         }
  220.         return $this;
  221.     }
  222.     public function isGotTest(): ?bool
  223.     {
  224.         return $this->gotTest;
  225.     }
  226.     public function setGotTest(bool $gotTest): static
  227.     {
  228.         $this->gotTest $gotTest;
  229.         return $this;
  230.     }
  231. }