src/Entity/UserEntity.php line 17

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\DBAL\Types\Types;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Symfony\Component\Form\Extension\Core\DataTransformer\DateTimeToStringTransformer;
  8. /**
  9.  * @ORM\Entity(repositoryClass="App\Repository\UserRepository")
  10.  * @ORM\Table(name="user")
  11.  * @ORM\HasLifecycleCallbacks()
  12.  */
  13. class UserEntity
  14. {
  15.     /**
  16.      * @ORM\Column(type="bigint")
  17.      * @ORM\Id
  18.      * @ORM\GeneratedValue(strategy="AUTO")
  19.      */
  20.     protected $id;
  21.     /**
  22.      * @ORM\Column(type="string")
  23.      */
  24.     protected $password;
  25.      /**bu
  26.      * @ORM\Column(name="forgot_password_code", type="string", nullable=true)
  27.      */
  28.     protected $forgotPasswordCode;
  29.     /**
  30.      * @ORM\Column(type="string")
  31.      */
  32.     protected $type;
  33.     /**
  34.      * @ORM\Column(name="is_active", type="boolean")
  35.      */
  36.     protected $isActive;
  37.     /**
  38.      * @ORM\Column(name="has_first_referral", type="boolean")
  39.      */
  40.     protected $hasFirstReferral;
  41.     /**
  42.      * @ORM\Column(name="has_enabled_two_fa", type="boolean")
  43.      */
  44.     protected $hasEnabledTwoFa;
  45.     /**
  46.      * @ORM\Column(name="is_newsletter_subscriber", type="boolean", nullable=true)
  47.      */
  48.     protected $isNewsletterSubscriber;
  49.     /**
  50.      * @ORM\Column(name="two_fa", type="boolean")
  51.      */
  52.     protected $twoFa;
  53.     
  54.      /**
  55.      * @ORM\Column(name="two_fa_code", type="string", nullable=true)
  56.      */
  57.     protected $twoFaCode;
  58.      /**
  59.      * @ORM\Column(name="status", type="string")
  60.      */
  61.     protected $status;
  62.     /**
  63.      * @ORM\Column(name="first_name", type="string", nullable=true)
  64.      */
  65.     protected $firstName;
  66.     /**
  67.      * @ORM\Column(name="last_name", type="string", nullable=true)
  68.      */
  69.     protected $lastName;
  70.     /**
  71.      * @ORM\Column(name="email", type="string")
  72.      */
  73.     protected $email;
  74.     /**
  75.      * @ORM\Column(name="token", type="string")
  76.      */
  77.     protected $token;
  78.     /**
  79.      * @ORM\Column(name="referral_code", type="string", nullable=true)
  80.      */
  81.     protected $referralCode;
  82.      /**
  83.      * @ORM\Column(name="exchange_phrase", type="string", nullable=true)
  84.      */
  85.     protected $exchangePhrase;
  86.     /**
  87.      * @ORM\Column(name="ip_address", type="string", nullable=true)
  88.      */
  89.     protected $ipAddress;
  90.     
  91.     /**
  92.      * @ORM\Column(name="clo_address", type="string", nullable=true)
  93.      */
  94.     protected $cloAddress;
  95.      /**
  96.      * @ORM\Column(name="wallet_address", type="string", nullable=true)
  97.      */
  98.     protected $walletAddress;
  99.     
  100.      /**
  101.      * @ORM\Column(name="kyc_status", type="string", nullable=true)
  102.      */
  103.     protected $kycStatus;
  104.     
  105.      /**
  106.      * @ORM\Column(name="birth_date", type="datetime", nullable=true)
  107.      */
  108.     protected $birthDate;
  109.      /**
  110.      * @ORM\Column(name="phone_no", type="string", nullable=true)
  111.      */
  112.     protected $phoneNo;
  113.      /**
  114.      * @ORM\Column(name="nationality", type="string", nullable=true)
  115.      */
  116.     protected $nationality;
  117.     
  118.      /**
  119.      * @ORM\Column(name="address1", type="string", nullable=true)
  120.      */
  121.     protected $address1;
  122.      /**
  123.      * @ORM\Column(name="address2", type="string", nullable=true)
  124.      */
  125.     protected $address2;
  126.     
  127.      /**
  128.      * @ORM\Column(name="city", type="string", nullable=true)
  129.      */
  130.     protected $city;
  131.      /**
  132.      * @ORM\Column(name="zip_code", type="string", nullable=true)
  133.      */
  134.     protected $zipCode;
  135.       /**
  136.      * @ORM\Column(name="fb_page_link", type="string", nullable=true)
  137.      */
  138.     protected $fbPageLink;
  139.     
  140.       /**
  141.      * @ORM\Column(name="twitter_page_link", type="string", nullable=true)
  142.      */
  143.     protected $twitterPageLink;
  144.     
  145.       /**
  146.      * @ORM\Column(name="ig_page_link", type="string", nullable=true)
  147.      */
  148.     protected $igPageLink;
  149.     
  150.      /**
  151.      * @ORM\Column(name="id_file", type="string", nullable=true)
  152.      */
  153.     protected $idFile;
  154.      /**
  155.      * @ORM\Column(name="id_file_parse", type="string", nullable=true)
  156.      */
  157.     protected $idFileParse;
  158.      /**
  159.      * @ORM\Column(name="id_type", type="string", nullable=true)
  160.      */
  161.     protected $idType;
  162.      /**
  163.      * @ORM\Column(name="avatar", type="string", nullable=true)
  164.      */
  165.     protected $avatar;
  166.     /**
  167.      * @ORM\Column(name="card_no", type="string", nullable=true)
  168.      */
  169.     protected $cardNo;
  170.        /**
  171.      * @ORM\Column(name="country", type="string", nullable=true)
  172.      */
  173.     protected $country;
  174.     /**
  175.      * @ORM\Column(name="created_by", type="string", length=50)
  176.      */
  177.     protected $createdBy;
  178.     /**
  179.      * @ORM\Column(name="created_at", type="datetime")
  180.      */
  181.     protected $createdAt;
  182.     /**
  183.      * @ORM\Column(name="updated_by", type="string", length=50)
  184.      */
  185.     protected $updatedBy;
  186.     /**
  187.      * @ORM\Column(name="updated_at", type="datetime")
  188.      */
  189.     protected $updatedAt;
  190.     /**
  191.      * @ORM\OneToOne(targetEntity="ReferralEntity", inversedBy="referrent")
  192.      * @ORM\JoinColumn(name="referral_id", referencedColumnName="id")
  193.      */
  194.     protected $referral;
  195.         /**
  196.      * @ORM\OneToMany(targetEntity="UserOrderTokenEntity", mappedBy="user", cascade={"remove"})
  197.      * @ORM\OrderBy({"createdAt": "DESC"})
  198.      */
  199.     protected $userOrderTokens;
  200.     /**
  201.      * @ORM\OneToMany(targetEntity="ReferralEntity", mappedBy="referrer", cascade={"remove"})
  202.      */
  203.     protected $referrals;
  204.     /**
  205.      * @ORM\OneToMany(targetEntity="UserBonusTokenEntity", mappedBy="user", cascade={"remove"})
  206.      * @ORM\OrderBy({"createdAt": "ASC"})
  207.      */
  208.     protected $userBonusTokens;
  209.     /**
  210.      * @ORM\OneToMany(targetEntity="SupportTicketEntity", mappedBy="user", cascade={"remove"})
  211.      */
  212.     protected $supportTickets;
  213.      /**
  214.      * @ORM\OneToMany(targetEntity="SupportTicketResponseEntity", mappedBy="user", cascade={"remove"})
  215.      */
  216.     protected $supportTicketResponses;
  217.      /**
  218.      * @ORM\OneToMany(targetEntity="NotificationEntity", mappedBy="user", cascade={"remove"})
  219.      */
  220.     protected $notifications;
  221.       /**
  222.      * @ORM\OneToMany(targetEntity="UserAdjustedTokenEntity", mappedBy="user", cascade={"remove"})
  223.      */
  224.     protected $userAdjustedTokens;
  225.     /**
  226.      * @ORM\OneToMany(targetEntity="BannedUserEntity", mappedBy="user", cascade={"remove"})
  227.      */
  228.     protected $bannedUsers;
  229.     /**
  230.      * @ORM\OneToMany(targetEntity="UserStakeTokenEntity", mappedBy="user", cascade={"remove"})
  231.      */
  232.     protected $userStakeTokens;
  233.     /**
  234.      * @ORM\OneToMany(targetEntity="UserEmailEntity", mappedBy="user", cascade={"remove"})
  235.      */
  236.     protected $userEmails;
  237.      /**
  238.      * @ORM\OneToMany(targetEntity="UserMemeCoinEntity", mappedBy="user", cascade={"remove"})
  239.      */
  240.     protected $userMemeCoins;
  241.      /**
  242.      * @ORM\OneToMany(targetEntity="UserMemeCoinTransactionEntity", mappedBy="buyer", cascade={"remove"})
  243.      */
  244.     protected $userMemeCoinTransactionBuyers;
  245.      /**
  246.      * @ORM\OneToMany(targetEntity="UserMemeCoinTransactionEntity", mappedBy="seller", cascade={"remove"})
  247.      */
  248.     protected $userMemeCoinTransactionSellers;
  249.     /**
  250.      * Set createdAt
  251.      *
  252.      * @ORM\PrePersist
  253.      */
  254.     public function setCreatedAtValue()
  255.     {
  256.         $this->createdBy = isset($_COOKIE['username']) ? $_COOKIE['username'] : 'System';
  257.         $this->createdAt = new \DateTime();
  258.         $this->updatedBy = isset($_COOKIE['username']) ? $_COOKIE['username'] : 'System';
  259.         $this->updatedAt = new \DateTime();
  260.         $this->status "For Verification";
  261.         $this->isActive true;
  262.         $this->twoFa false;
  263.         $this->isNewsLetterSubscriber false;
  264.         $this->hasFirstReferral false;
  265.         $this->hasEnabledTwoFa false;
  266.         $this->kycStatus 'For-Application';
  267.     }
  268.     /**
  269.      * Set updatedAt
  270.      *
  271.      * @ORM\PreUpdate
  272.      */
  273.     public function setUpdatedAtValue()
  274.     {
  275.         $this->updatedBy = isset($_COOKIE['username']) ? $_COOKIE['username'] : 'System';
  276.         $this->updatedAt = new \DateTime();
  277.     }
  278.         /**
  279.      * Remove the file from the disk
  280.      *
  281.      * @ORM\PreRemove
  282.      */
  283.     public function removeFile() {
  284.         $file $this->getUploadRootDir() . '/' $this->idFileParse;
  285.         if(!empty($this->idFileParse) && file_exists($file)) unlink($file);
  286.     }
  287.         /**
  288.      * Get uploadDir
  289.      *
  290.      * @return string
  291.      */
  292.     public function getUploadDir() {
  293.         return '/uploads/file';
  294.     }
  295.     /**
  296.      * Get uploadRootDir
  297.      *
  298.      * @return string
  299.      */
  300.     public function getUploadRootDir() {
  301.         return __DIR__ './../../public' $this->getUploadDir();
  302.     }
  303.     /**
  304.      * get fileWebPath
  305.      *
  306.      * @return string
  307.      */
  308.     public function getFileWebPath() {
  309.         $parsedDesc $this->idFileParse;
  310.         $file $this->getUploadRootDir() . '/' $parsedDesc;
  311.      
  312.         if(!empty($parsedDesc) ) {
  313.             return   $this->getUploadDir() . '/' $parsedDesc;
  314.         } else {
  315.             return '';
  316.         }
  317.        
  318.     }
  319.     
  320.     public function __construct($data null)
  321.     {
  322.         if (!is_null($data)) {
  323.             $this->userOrderTokens = new ArrayCollection();
  324.             $this->userBonusTokens = new ArrayCollection();
  325.             $this->userAdjustedTokens = new ArrayCollection();
  326.             $this->bannedUsers =  new ArrayCollection();
  327.             $this->userMemeCoins =  new ArrayCollection();
  328.         }
  329.         $this->referrals = new ArrayCollection();
  330.         $this->supportTickets = new ArrayCollection();
  331.         $this->supportTicketResponses = new ArrayCollection();
  332.         $this->notifications = new ArrayCollection();
  333.         $this->userStakeTokens = new ArrayCollection();
  334.         $this->userEmails = new ArrayCollection();
  335.         $this->userMemeCoinTransactionBuyers = new ArrayCollection();
  336.         $this->userMemeCoinTransactionSellers = new ArrayCollection(); 
  337.     }
  338.     /**
  339.      * Get fullName
  340.      *
  341.      * @return string
  342.      */
  343.     public function getFullName()
  344.     {
  345.         return $this->firstName .' ' $this->lastName;
  346.     }
  347.     /**
  348.      * Get parsedCardNo
  349.      *
  350.      * @return string
  351.      */
  352.     public function getParsedCardNo()
  353.     {
  354.         return wordwrap($this->cardNo ' ' true );
  355.     }
  356.     /**
  357.      * Get pinNo
  358.      *
  359.      * @return string
  360.      */
  361.     public function getPinNo()
  362.     {
  363.         return str_pad($this->id9"0"STR_PAD_RIGHT); ;
  364.     }
  365. /**
  366.  * Get aggregated MemeCoin holdings
  367.  *
  368.  * @return array
  369.  */
  370. public function memeCoinHelds(): array
  371. {
  372.     $holdings = [];
  373.     foreach ($this->getUserMemeCoinTransactionBuyers() as $b) {
  374.         $coin $b->getUserMemeCoin();
  375.         $id   $coin->getId();
  376.         if (!isset($holdings[$id])) {
  377.             $holdings[$id] = [
  378.                 'coin'          => $coin,
  379.                 'balance'       => 0,
  380.                 'value'         => 0,
  381.                 'portfolioShare'=> 0,
  382.             ];
  383.         }
  384.         // Add values from transaction
  385.         $holdings[$id]['balance']        += $b->getAmount();
  386.         $holdings[$id]['value']          += $b->getBasePrice();
  387.     }
  388.     return $holdings;
  389. }
  390.     /**
  391.      * Get isVerifiedProfile
  392.      *
  393.      * @return bool
  394.      */
  395.     public function isVerifiedProfile(){
  396.         return $this->getFirstName() != '' && $this->getLastName() != '' && $this->getWalletAddress() != '' && $this->getEmail() != '' && $this->getCountry() != ''
  397.     }
  398.     
  399.     
  400.     /**
  401.      * Get totalBalance
  402.      *
  403.      * @return string
  404.      */
  405.     public function totalBalance() {
  406.         $balance 0;
  407.         foreach ($this->userOrderTokens as $order){
  408.             if($order->getStatus() == 'Completed'){
  409.                 $balance += $order->getTokenAmount();
  410.             }
  411.         }
  412.         foreach ($this->userBonusTokens as $bonus){
  413.            $balance += $bonus->getAmount();
  414.         }
  415.         foreach ($this->userAdjustedTokens as $token){
  416.             if($token->getReason() == 'Burn'){
  417.            $balance -= $token->getAmount();
  418.             } else{
  419.            $balance += $token->getAmount();
  420.             }
  421.         }
  422.         foreach ($this->userStakeTokens as $token){
  423.             if($token->getStatus() == 'On Staking'){
  424.                 $balance -= $token->getTokenAmount();
  425.             }
  426.          }
  427.          foreach ($this->userMemeCoins as $memeCoin){
  428.            // if($token->getStatus() == 'On Staking'){
  429.                 $balance -= $memeCoin->getBurnAmount();
  430.                 $balance -= $memeCoin->getRecycleAmount();
  431.             //}
  432.          }
  433.          foreach($this->userMemeCoinTransactionBuyers as $buyer){
  434.             $balance-= $buyer->getAmount() * $buyer->getBasePrice(); 
  435.          }
  436.          foreach($this->userMemeCoinTransactionSellers as $seller){
  437.             $balance+= ($seller->getAmount() * $seller->getBasePrice()) - $seller->getSystemFee(); 
  438.          }
  439.            foreach($this->getUserAdjustedTokens() as $adjustedToken){
  440.             if($adjustedToken->getReason() == 'Burn'){
  441.                 $balance-= $adjustedToken->getAmount(); 
  442.             }
  443.          }
  444.         return $balance;
  445.     }
  446.      /**
  447.      * Get totalBalanceWithoutMemeCoint
  448.      *
  449.      * @return string
  450.      */
  451.     public function totalBalanceWithoutMemeCoint() {
  452.         $balance 0;
  453.         foreach ($this->userOrderTokens as $order){
  454.             if($order->getStatus() == 'Completed'){
  455.                 $balance += $order->getTokenAmount();
  456.             }
  457.         }
  458.         foreach ($this->userBonusTokens as $bonus){
  459.            $balance += $bonus->getAmount();
  460.         }
  461.         // foreach ($this->userAdjustedTokens as $token){
  462.         //     if($token->getReason() == 'Burn'){
  463.         //    $balance -= $token->getAmount();
  464.         //     } else{
  465.         //    $balance += $token->getAmount();
  466.         //     }
  467.         // }
  468.         foreach ($this->userStakeTokens as $token){
  469.             if($token->getStatus() == 'On Staking'){
  470.                 $balance -= $token->getTokenAmount();
  471.             }
  472.          }
  473.          foreach ($this->userMemeCoins as $memeCoin){
  474.            // if($token->getStatus() == 'On Staking'){
  475.                 $balance -= $memeCoin->getBurnAmount();
  476.                 $balance -= $memeCoin->getRecycleAmount();
  477.             //}
  478.          }
  479.          foreach($this->userMemeCoinTransactionBuyers as $buyer){
  480.             $balance-= $buyer->getAmount() * $buyer->getBasePrice(); 
  481.          }
  482.            foreach($this->getUserAdjustedTokens() as $adjustedToken){
  483.             if($adjustedToken->getReason() == 'Burn'){
  484.                 $balance-= $adjustedToken->getAmount(); 
  485.             }
  486.          }
  487.      
  488.         return $balance;
  489.     }
  490.       /**
  491.      * Get totalMemeCoinsBalance
  492.      *
  493.      * @return string
  494.      */
  495.     public function totalMemeCoinsBalance() {
  496.         $balance 0;
  497.          foreach($this->userMemeCoinTransactionBuyers as $buyer){
  498.             $balance-= $buyer->getAmount() * $buyer->getBasePrice(); 
  499.          }
  500.         return $balance;
  501.     }
  502.     
  503.     /**
  504.  * @ORM\Column(type="string", length=255, nullable=true)
  505.  */
  506. protected $reason;
  507. public function getReason(): ?string
  508. {
  509.     return $this->reason;
  510. }
  511. public function setReason(?string $reason): self
  512. {
  513.     $this->reason $reason;
  514.     return $this;
  515. }
  516.     
  517.     
  518.     
  519. /**
  520.      * Get totalStakeReward
  521.      *
  522.      * @return string
  523.      */
  524.     public function totalStakeReward() {
  525.         $balance 0;
  526.         foreach ($this->userStakeTokens as $token){
  527.             if($token->getStatus() == 'Completed'){
  528.                 $balance += $token->getInterest();
  529.             }
  530.          }
  531.         return $balance;
  532.     }
  533.     
  534.      /**
  535.      * Get totalStakeBalance
  536.      *
  537.      * @return string
  538.      */
  539.     public function totalStakeBalance() {
  540.         $balance 0;
  541.         foreach ($this->userOrderTokens as $order){
  542.             if($order->getStatus() == 'Completed'){
  543.                 $balance += $order->getTokenAmount();
  544.             }
  545.         }
  546.         foreach ($this->userBonusTokens as $bonus){
  547.            $balance += $bonus->getAmount();
  548.         }
  549.         foreach ($this->userAdjustedTokens as $token){
  550.            $balance += $token->getAmount();
  551.         }
  552.         foreach ($this->userStakeTokens as $token){
  553.             $balance -= $token->getTokenAmount();
  554.          }
  555.         return $balance;
  556.     }
  557.      /**
  558.      * Get totalOnStakeBalance
  559.      *
  560.      * @return string
  561.      */
  562.     public function totalOnStakeBalance() {
  563.         $balance 0;
  564.         foreach ($this->userStakeTokens as $token){
  565.             if($token->getStatus() == 'On Staking'){
  566.                 $balance += $token->getTokenAmount();
  567.             }
  568.          }
  569.         return $balance;
  570.     }
  571. public function getTotalReferrals()
  572. {
  573.     $qb $this->createQueryBuilder('r');
  574.     
  575.     $qb->select('SELECT COUNT(r.`id`) AS totalReferral, r.`referrer_id` FROM `referral` r WHERE r.`status` = `Completed` GROUP BY r.`referrer_id` ORDER BY `totalReferral` DESC');
  576.    
  577.     return $qb->getQuery()->getResult();
  578. }
  579.      public function totalreferrallist($user, array $get){
  580.         $referralcount $sql->query("LEFT JOIN SELECT COUNT(r.`id`) AS totalReferral, r.`referrer_id` FROM `referral` r WHERE r.`status` = 'Completed' GROUP BY r.`referrer_id`;");
  581.     $query $this->getEntityManager()->getConnection()->prepare("
  582.                   LEFT JOIN
  583.                   SELECT COUNT(r.`id`) AS totalReferral, r.`referrer_id` FROM `referral` r WHERE r.`status` = 'Completed' GROUP BY r.`referrer_id`;
  584.         ");
  585.         $query->execute($stmtParams);
  586.         $result $query->fetchAll();
  587.         return !empty($result) ? $result[0]['totalreferrallist'] : 0;
  588.     }  
  589.     
  590.   /**
  591.      * Get totalPurchase
  592.      *
  593.      * @return int
  594.      */
  595.     public function getTotalPurchase() {
  596.         $balance 0;
  597.         foreach ($this->userOrderTokens as $order){
  598.             if($order->getStatus() == 'Completed'){
  599.                
  600.                  $balance += $order->getTokenAmount();
  601.             }
  602.         }
  603.         return $balance;
  604.     }
  605.     /**
  606.      * Get totalBonus
  607.      *
  608.      * @return int
  609.      */
  610.     public function getTotalBonus() {
  611.         $balance 0;
  612.            
  613.         foreach ($this->userBonusTokens as $bonus){
  614.              $balance += $bonus->getAmount();
  615.         }
  616.         return $balance;
  617.     }
  618.     
  619.     /**
  620.      * Get septTotalBalance
  621.      *
  622.      * @return string
  623.      */
  624.     public function septTotalBalance() {
  625.         $balance 0;
  626.         $d1 = new \DateTime('2022-09-30 24:59:59');
  627.  
  628.         foreach ($this->userOrderTokens as $order){
  629.             if($order->getStatus() == 'Completed'){
  630.                
  631.                 if($order->getUpdatedAt() <= $d1){
  632.                     $balance += $order->getTokenAmount();
  633.                  
  634.                 }
  635.             }
  636.         }
  637.         foreach ($this->userBonusTokens as $bonus){
  638.             if($bonus->getUpdatedAt() <= $d1){
  639.                  $balance += $bonus->getAmount();
  640.             }
  641.         }
  642.         foreach ($this->userAdjustedTokens as $token){
  643.             if($token->getUpdatedAt() <= $d1){
  644.              $balance += $token->getAmount();
  645.             }
  646.         }
  647.         return $balance;
  648.     }
  649.     /**
  650.      * Get hasTaskTokens
  651.      *
  652.      * @return boolean
  653.      */
  654.     public function hasTaskTokens() {
  655.         $balance 0;
  656.         foreach ($this->userOrderTokens as $order){
  657.             if($order->getStatus() == 'Completed'){
  658.                 $balance += $order->getTokenAmount();
  659.             }
  660.         }
  661.         foreach ($this->userBonusTokens as $bonus){
  662.            $balance += $bonus->getAmount();
  663.         }
  664.         foreach ($this->userAdjustedTokens as $token){
  665.            $balance += $token->getAmount();
  666.         }
  667.         return $balance >= 100000 true false ;
  668.     }
  669.     /**
  670.      * Get btcContribution
  671.      *
  672.      * @return string
  673.      */
  674.     public function btcContribution() {
  675.         $ctr 0;
  676.         foreach ($this->userOrderTokens as $order){
  677.             if($order->getStatus() == 'Completed' && $order->getNetwork() == 'BTC' ){
  678.                 $ctr += $order->getTokenValue();
  679.             }
  680.         }
  681.         return $ctr;
  682.     }
  683.     /**
  684.      * Get ltcContribution
  685.      *0
  686.      * @return string
  687.      */
  688.     public function ltcContribution() {
  689.         $ctr 0;
  690.         foreach ($this->userOrderTokens as $order){
  691.             if($order->getStatus() == 'Completed' && $order->getNetwork() == 'LTC' ){
  692.                 $ctr += $order->getAmount();
  693.             }
  694.         }
  695.         return $ctr;
  696.     }
  697.     /**
  698.      * Get dogeContribution
  699.      *0
  700.      * @return string
  701.      */
  702.     public function dogeContribution() {
  703.         $ctr 0;
  704.         foreach ($this->userOrderTokens as $order){
  705.             if($order->getStatus() == 'Completed' && $order->getNetwork() == 'DOGE' ){
  706.                 $ctr += $order->getAmount();
  707.             }
  708.         }
  709.         return $ctr;
  710.     }
  711.     /**
  712.      * Get ethContribution
  713.      *0
  714.      * @return string
  715.      */
  716.     public function ethContribution() {
  717.         $ctr 0;
  718.         foreach ($this->userOrderTokens as $order){
  719.             if($order->getStatus() == 'Completed' && $order->getNetwork() == 'ETH' ){
  720.                 $ctr += $order->getTokenValue();
  721.             }
  722.         }
  723.         return $ctr;
  724.     }
  725.         /**
  726.      * Get bnbContribution
  727.      *0
  728.      * @return string
  729.      */
  730.     public function bnbContribution() {
  731.         $ctr 0;
  732.         foreach ($this->userOrderTokens as $order){
  733.             if($order->getStatus() == 'Completed' && $order->getNetwork() == 'BNB' ){
  734.                 $ctr += $order->getTokenValue();
  735.             }
  736.         }
  737.         return $ctr;
  738.     }
  739.     
  740.     /**
  741.      * Get referralCtr
  742.      *
  743.      * @return string
  744.      */
  745.     public function getReferralCtr() {
  746.         return count($this->getReferrals());
  747.     }
  748.     /**
  749.      * Get earlyReferal
  750.      *
  751.      * @return bool
  752.      */
  753.     public function hasReferralWithin24h(): bool
  754. {
  755.     $registeredAt $this->getCreatedAt();
  756.     $deadline     = (clone $registeredAt)->modify('+24 hours');
  757.     foreach ($this->getReferrals() as $referral) {
  758.         if ($referral->getCreatedAt() <= $deadline) {
  759.             return true;
  760.         }
  761.     }
  762.     return false;
  763. }
  764.  /**
  765.      * Get isThreeMonthsOld
  766.      *
  767.      * @return bool
  768.      */
  769. public function isThreeMonthsOld(): bool
  770. {
  771.     $createdAt $this->getCreatedAt();
  772.     $threeMonthsAgo = (new \DateTime())->modify('-3 months');
  773.     return $createdAt <= $threeMonthsAgo;
  774. }
  775.     /*--------------------------------------------------------------------------------------------------------*/
  776.     /*                        Defined Setters and Getters                                                          */
  777.     /*--------------------------------------------------------------------------------------------------------*/
  778.     /**
  779.      * Get id.
  780.      *
  781.      * @return int
  782.      */
  783.     public function getId()
  784.     {
  785.         return $this->id;
  786.     }
  787.     /**
  788.      * Set password.
  789.      *
  790.      * @param string $password
  791.      *
  792.      * @return UserEntity
  793.      */
  794.     public function setPassword($password)
  795.     {
  796.         $this->password $password;
  797.         return $this;
  798.     }
  799.     /**
  800.      * Get password.
  801.      *
  802.      * @return string
  803.      */
  804.     public function getPassword()
  805.     {
  806.         return $this->password;
  807.     }
  808.     /**
  809.      * Set type.
  810.      *
  811.      * @param string $type
  812.      *
  813.      * @return UserEntity
  814.      */
  815.     public function setType($type)
  816.     {
  817.         $this->type $type;
  818.         return $this;
  819.     }
  820.     /**
  821.      * Get type.
  822.      *
  823.      * @return string
  824.      */
  825.     public function getType()
  826.     {
  827.         return $this->type;
  828.     }
  829.     /**
  830.      * Set isActive.
  831.      *
  832.      * @param bool $isActive
  833.      *
  834.      * @return UserEntity
  835.      */
  836.     public function setIsActive($isActive)
  837.     {
  838.         $this->isActive $isActive;
  839.         return $this;
  840.     }
  841.     /**
  842.      * Get isActive.
  843.      *
  844.      * @return bool
  845.      */
  846.     public function getIsActive()
  847.     {
  848.         return $this->isActive;
  849.     }
  850.     /**
  851.      * Set firstName.
  852.      *
  853.      * @param string|null $firstName
  854.      *
  855.      * @return UserEntity
  856.      */
  857.     public function setFirstName($firstName null)
  858.     {
  859.         $this->firstName $firstName;
  860.         return $this;
  861.     }
  862.     /**
  863.      * Get firstName.
  864.      *
  865.      * @return string|null
  866.      */
  867.     public function getFirstName()
  868.     {
  869.         return $this->firstName;
  870.     }
  871.     /**
  872.      * Set lastName.
  873.      *
  874.      * @param string|null $lastName
  875.      *
  876.      * @return UserEntity
  877.      */
  878.     public function setLastName($lastName null)
  879.     {
  880.         $this->lastName $lastName;
  881.         return $this;
  882.     }
  883.     /**
  884.      * Get lastName.
  885.      *
  886.      * @return string|null
  887.      */
  888.     public function getLastName()
  889.     {
  890.         return $this->lastName;
  891.     }
  892.     /**
  893.      * Set email.
  894.      *
  895.      * @param string $email
  896.      *
  897.      * @return UserEntity
  898.      */
  899.     public function setEmail($email)
  900.     {
  901.         $this->email $email;
  902.         return $this;
  903.     }
  904.     /**
  905.      * Get email.
  906.      *
  907.      * @return string
  908.      */
  909.     public function getEmail()
  910.     {
  911.         return $this->email;
  912.     }
  913.     /**
  914.      * Set createdBy.
  915.      *
  916.      * @param string $createdBy
  917.      *
  918.      * @return UserEntity
  919.      */
  920.     public function setCreatedBy($createdBy)
  921.     {
  922.         $this->createdBy $createdBy;
  923.         return $this;
  924.     }
  925.     /**
  926.      * Get createdBy.
  927.      *
  928.      * @return string
  929.      */
  930.     public function getCreatedBy()
  931.     {
  932.         return $this->createdBy;
  933.     }
  934.     /**
  935.      * Set createdAt.
  936.      *
  937.      * @param \DateTime $createdAt
  938.      *
  939.      * @return UserEntity
  940.      */
  941.     public function setCreatedAt($createdAt)
  942.     {
  943.         $this->createdAt $createdAt;
  944.         return $this;
  945.     }
  946.     /**
  947.      * Get createdAt.
  948.      *
  949.      * @return \DateTime
  950.      */
  951.     public function getCreatedAt()
  952.     {
  953.         return $this->createdAt;
  954.     }
  955.     /**
  956.      * Set updatedBy.
  957.      *
  958.      * @param string $updatedBy
  959.      *
  960.      * @return UserEntity
  961.      */
  962.     public function setUpdatedBy($updatedBy)
  963.     {
  964.         $this->updatedBy $updatedBy;
  965.         return $this;
  966.     }
  967.     /**
  968.      * Get updatedBy.
  969.      *
  970.      * @return string
  971.      */
  972.     public function getUpdatedBy()
  973.     {
  974.         return $this->updatedBy;
  975.     }
  976.     /**
  977.      * Set updatedAt.
  978.      *
  979.      * @param \DateTime $updatedAt
  980.      *
  981.      * @return UserEntity
  982.      */
  983.     public function setUpdatedAt($updatedAt)
  984.     {
  985.         $this->updatedAt $updatedAt;
  986.         return $this;
  987.     }
  988.     /**
  989.      * Get updatedAt.
  990.      *
  991.      * @return \DateTime
  992.      */
  993.     public function getUpdatedAt()
  994.     {
  995.         return $this->updatedAt;
  996.     }
  997.     /**
  998.      * Set status.
  999.      *
  1000.      * @param bool $status
  1001.      *
  1002.      * @return UserEntity
  1003.      */
  1004.     public function setStatus($status)
  1005.     {
  1006.         $this->status $status;
  1007.         return $this;
  1008.     }
  1009.     /**
  1010.      * Get status.
  1011.      *
  1012.      * @return bool
  1013.      */
  1014.     public function getStatus()
  1015.     {
  1016.         return $this->status;
  1017.     }
  1018.     /**
  1019.      * Add userOrderToken.
  1020.      *
  1021.      * @param \App\Entity\UserOrderTokenEntity $userOrderToken
  1022.      *
  1023.      * @return UserEntity
  1024.      */
  1025.     public function addUserOrderToken(\App\Entity\UserOrderTokenEntity $userOrderToken)
  1026.     {
  1027.         $this->userOrderTokens[] = $userOrderToken;
  1028.         return $this;
  1029.     }
  1030.     /**
  1031.      * Remove userOrderToken.
  1032.      *
  1033.      * @param \App\Entity\UserOrderTokenEntity $userOrderToken
  1034.      *
  1035.      * @return boolean TRUE if this collection contained the specified element, FALSE otherwise.
  1036.      */
  1037.     public function removeUserOrderToken(\App\Entity\UserOrderTokenEntity $userOrderToken)
  1038.     {
  1039.         return $this->userOrderTokens->removeElement($userOrderToken);
  1040.     }
  1041.     /**
  1042.      * Get userOrderTokens.
  1043.      *
  1044.      * @return \Doctrine\Common\Collections\Collection
  1045.      */
  1046.     public function getUserOrderTokens()
  1047.     {
  1048.         return $this->userOrderTokens;
  1049.     }
  1050.     /**
  1051.      * Add referral.
  1052.      *
  1053.      * @param \App\Entity\ReferralEntity $referral
  1054.      *
  1055.      * @return UserEntity
  1056.      */
  1057.     public function addReferral(\App\Entity\ReferralEntity $referral)
  1058.     {
  1059.         $this->referrals[] = $referral;
  1060.         return $this;
  1061.     }
  1062.     /**
  1063.      * Remove referral.
  1064.      *
  1065.      * @param \App\Entity\ReferralEntity $referral
  1066.      *
  1067.      * @return boolean TRUE if this collection contained the specified element, FALSE otherwise.
  1068.      */
  1069.     public function removeReferral(\App\Entity\ReferralEntity $referral)
  1070.     {
  1071.         return $this->referrals->removeElement($referral);
  1072.     }
  1073.     /**
  1074.      * Get referrals.
  1075.      *
  1076.      * @return \Doctrine\Common\Collections\Collection
  1077.      */
  1078.     public function getReferrals()
  1079.     {
  1080.         return $this->referrals;
  1081.     }
  1082.     /**
  1083.      * Add userBonusToken.
  1084.      *
  1085.      * @param \App\Entity\UserBonusTokenEntity $userBonusToken
  1086.      *
  1087.      * @return UserEntity
  1088.      */
  1089.     public function addUserBonusToken(\App\Entity\UserBonusTokenEntity $userBonusToken)
  1090.     {
  1091.         $this->userBonusTokens[] = $userBonusToken;
  1092.         return $this;
  1093.     }
  1094.     /**
  1095.      * Remove userBonusToken.
  1096.      *
  1097.      * @param \App\Entity\UserBonusTokenEntity $userBonusToken
  1098.      *
  1099.      * @return boolean TRUE if this collection contained the specified element, FALSE otherwise.
  1100.      */
  1101.     public function removeUserBonusToken(\App\Entity\UserBonusTokenEntity $userBonusToken)
  1102.     {
  1103.         return $this->userBonusTokens->removeElement($userBonusToken);
  1104.     }
  1105.     /**
  1106.      * Get userBonusTokens.
  1107.      *
  1108.      * @return \Doctrine\Common\Collections\Collection
  1109.      */
  1110.     public function getUserBonusTokens()
  1111.     {
  1112.         return $this->userBonusTokens;
  1113.     }
  1114.     /**
  1115.      * Set referral.
  1116.      *
  1117.      * @param \App\Entity\ReferralEntity|null $referral
  1118.      *
  1119.      * @return UserEntity
  1120.      */
  1121.     public function setReferral(\App\Entity\ReferralEntity $referral null)
  1122.     {
  1123.         $this->referral $referral;
  1124.         return $this;
  1125.     }
  1126.     /**
  1127.      * Get referral.
  1128.      *
  1129.      * @return \App\Entity\ReferralEntity|null
  1130.      */
  1131.     public function getReferral()
  1132.     {
  1133.         return $this->referral;
  1134.     }
  1135.     /**
  1136.      * Set referralCode.
  1137.      *
  1138.      * @param string|null $referralCode
  1139.      *
  1140.      * @return UserEntity
  1141.      */
  1142.     public function setReferralCode($referralCode null)
  1143.     {
  1144.         $this->referralCode $referralCode;
  1145.         return $this;
  1146.     }
  1147.     /**
  1148.      * Get referralCode.
  1149.      *
  1150.      * @return string|null
  1151.      */
  1152.     public function getReferralCode()
  1153.     {
  1154.         return $this->referralCode;
  1155.     }
  1156.     /**
  1157.      * Set token.
  1158.      *
  1159.      * @param string $token
  1160.      *
  1161.      * @return UserEntity
  1162.      */
  1163.     public function setToken($token)
  1164.     {
  1165.         $this->token $token;
  1166.         return $this;
  1167.     }
  1168.     /**
  1169.      * Get token.
  1170.      *
  1171.      * @return string
  1172.      */
  1173.     public function getToken()
  1174.     {
  1175.         return $this->token;
  1176.     }
  1177.     /**
  1178.      * Add supportTicket.
  1179.      *
  1180.      * @param \App\Entity\SupportTicketEntity $supportTicket
  1181.      *
  1182.      * @return UserEntity
  1183.      */
  1184.     public function addSupportTicket(\App\Entity\SupportTicketEntity $supportTicket)
  1185.     {
  1186.         $this->supportTickets[] = $supportTicket;
  1187.         return $this;
  1188.     }
  1189.     /**
  1190.      * Remove supportTicket.
  1191.      *
  1192.      * @param \App\Entity\SupportTicketEntity $supportTicket
  1193.      *
  1194.      * @return boolean TRUE if this collection contained the specified element, FALSE otherwise.
  1195.      */
  1196.     public function removeSupportTicket(\App\Entity\SupportTicketEntity $supportTicket)
  1197.     {
  1198.         return $this->supportTickets->removeElement($supportTicket);
  1199.     }
  1200.     /**
  1201.      * Get supportTickets.
  1202.      *
  1203.      * @return \Doctrine\Common\Collections\Collection
  1204.      */
  1205.     public function getSupportTickets()
  1206.     {
  1207.         return $this->supportTickets;
  1208.     }
  1209.     /**
  1210.      * Add supportTicketResponse.
  1211.      *
  1212.      * @param \App\Entity\SupportTicketResponseEntity $supportTicketResponse
  1213.      *
  1214.      * @return UserEntity
  1215.      */
  1216.     public function addSupportTicketResponse(\App\Entity\SupportTicketResponseEntity $supportTicketResponse)
  1217.     {
  1218.         $this->supportTicketResponses[] = $supportTicketResponse;
  1219.         return $this;
  1220.     }
  1221.     /**
  1222.      * Remove supportTicketResponse.
  1223.      *
  1224.      * @param \App\Entity\SupportTicketResponseEntity $supportTicketResponse
  1225.      *
  1226.      * @return boolean TRUE if this collection contained the specified element, FALSE otherwise.
  1227.      */
  1228.     public function removeSupportTicketResponse(\App\Entity\SupportTicketResponseEntity $supportTicketResponse)
  1229.     {
  1230.         return $this->supportTicketResponses->removeElement($supportTicketResponse);
  1231.     }
  1232.     /**
  1233.      * Get supportTicketResponses.
  1234.      *
  1235.      * @return \Doctrine\Common\Collections\Collection
  1236.      */
  1237.     public function getSupportTicketResponses()
  1238.     {
  1239.         return $this->supportTicketResponses;
  1240.     }
  1241.     /**
  1242.      * Set exchangePhrase.
  1243.      *
  1244.      * @param string|null $exchangePhrase
  1245.      *
  1246.      * @return UserEntity
  1247.      */
  1248.     public function setExchangePhrase($exchangePhrase null)
  1249.     {
  1250.         $this->exchangePhrase $exchangePhrase;
  1251.         return $this;
  1252.     }
  1253.     /**
  1254.      * Get exchangePhrase.
  1255.      *
  1256.      * @return string|null
  1257.      */
  1258.     public function getExchangePhrase()
  1259.     {
  1260.         return $this->exchangePhrase;
  1261.     }
  1262.     /**
  1263.      * Set walletAddress.
  1264.      *
  1265.      * @param string|null $walletAddress
  1266.      *
  1267.      * @return UserEntity
  1268.      */
  1269.     public function setWalletAddress($walletAddress null)
  1270.     {
  1271.         $this->walletAddress $walletAddress;
  1272.         return $this;
  1273.     }
  1274.     /**
  1275.      * Get walletAddress.
  1276.      *
  1277.      * @return string|null
  1278.      */
  1279.     public function getWalletAddress()
  1280.     {
  1281.         return $this->walletAddress;
  1282.     }
  1283.     /**
  1284.      * Add notification.
  1285.      *
  1286.      * @param \App\Entity\NotificationEntity $notification
  1287.      *
  1288.      * @return UserEntity
  1289.      */
  1290.     public function addNotification(\App\Entity\NotificationEntity $notification)
  1291.     {
  1292.         $this->notifications[] = $notification;
  1293.         return $this;
  1294.     }
  1295.     /**
  1296.      * Remove notification.
  1297.      *
  1298.      * @param \App\Entity\NotificationEntity $notification
  1299.      *
  1300.      * @return boolean TRUE if this collection contained the specified element, FALSE otherwise.
  1301.      */
  1302.     public function removeNotification(\App\Entity\NotificationEntity $notification)
  1303.     {
  1304.         return $this->notifications->removeElement($notification);
  1305.     }
  1306.     /**
  1307.      * Get notifications.
  1308.      *
  1309.      * @return \Doctrine\Common\Collections\Collection
  1310.      */
  1311.     public function getNotifications()
  1312.     {
  1313.         return $this->notifications;
  1314.     }
  1315.     /**
  1316.      * Set ipAddress.
  1317.      *
  1318.      * @param string|null $ipAddress
  1319.      *
  1320.      * @return UserEntity
  1321.      */
  1322.     public function setIpAddress($ipAddress null)
  1323.     {
  1324.         $this->ipAddress $ipAddress;
  1325.         return $this;
  1326.     }
  1327.     /**
  1328.      * Get ipAddress.
  1329.      *
  1330.      * @return string|null
  1331.      */
  1332.     public function getIpAddress()
  1333.     {
  1334.         return $this->ipAddress;
  1335.     }
  1336.     /**
  1337.      * Set forgotPasswordCode.
  1338.      *
  1339.      * @param string $forgotPasswordCode
  1340.      *
  1341.      * @return UserEntity
  1342.      */
  1343.     public function setForgotPasswordCode($forgotPasswordCode)
  1344.     {
  1345.         $this->forgotPasswordCode $forgotPasswordCode;
  1346.         return $this;
  1347.     }
  1348.     /**
  1349.      * Get forgotPasswordCode.
  1350.      *
  1351.      * @return string
  1352.      */
  1353.     public function getForgotPasswordCode()
  1354.     {
  1355.         return $this->forgotPasswordCode;
  1356.     }
  1357.     /**
  1358.      * Set twoFa.
  1359.      *
  1360.      * @param bool $twoFa
  1361.      *
  1362.      * @return UserEntity
  1363.      */
  1364.     public function setTwoFa($twoFa)
  1365.     {
  1366.         $this->twoFa $twoFa;
  1367.         return $this;
  1368.     }
  1369.     /**
  1370.      * Get twoFa.
  1371.      *
  1372.      * @return bool
  1373.      */
  1374.     public function getTwoFa()
  1375.     {
  1376.         return $this->twoFa;
  1377.     }
  1378.     /**
  1379.      * Set twoFaCode.
  1380.      *
  1381.      * @param string|null $twoFaCode
  1382.      *
  1383.      * @return UserEntity
  1384.      */
  1385.     public function setTwoFaCode($twoFaCode null)
  1386.     {
  1387.         $this->twoFaCode $twoFaCode;
  1388.         return $this;
  1389.     }
  1390.     /**
  1391.      * Get twoFaCode.
  1392.      *
  1393.      * @return string|null
  1394.      */
  1395.     public function getTwoFaCode()
  1396.     {
  1397.         return $this->twoFaCode;
  1398.     }
  1399.     /**
  1400.      * Set hasFirstReferral.
  1401.      *
  1402.      * @param bool $hasFirstReferral
  1403.      *
  1404.      * @return UserEntity
  1405.      */
  1406.     public function setHasFirstReferral($hasFirstReferral)
  1407.     {
  1408.         $this->hasFirstReferral $hasFirstReferral;
  1409.         return $this;
  1410.     }
  1411.     /**
  1412.      * Get hasFirstReferral.
  1413.      *
  1414.      * @return bool
  1415.      */
  1416.     public function getHasFirstReferral()
  1417.     {
  1418.         return $this->hasFirstReferral;
  1419.     }
  1420.     /**
  1421.      * Set hasEnabledTwoFa.
  1422.      *
  1423.      * @param bool $hasEnabledTwoFa
  1424.      *
  1425.      * @return UserEntity
  1426.      */
  1427.     public function setHasEnabledTwoFa($hasEnabledTwoFa)
  1428.     {
  1429.         $this->hasEnabledTwoFa $hasEnabledTwoFa;
  1430.         return $this;
  1431.     }
  1432.     /**
  1433.      * Get hasEnabledTwoFa.
  1434.      *
  1435.      * @return bool
  1436.      */
  1437.     public function getHasEnabledTwoFa()
  1438.     {
  1439.         return $this->hasEnabledTwoFa;
  1440.     }
  1441.     /**
  1442.      * Add userAdjustedToken.
  1443.      *
  1444.      * @param \App\Entity\UserAdjustedTokenEntity $userAdjustedToken
  1445.      *
  1446.      * @return UserEntity
  1447.      */
  1448.     public function addUserAdjustedToken(\App\Entity\UserAdjustedTokenEntity $userAdjustedToken)
  1449.     {
  1450.         $this->userAdjustedTokens[] = $userAdjustedToken;
  1451.         return $this;
  1452.     }
  1453.     /**
  1454.      * Remove userAdjustedToken.
  1455.      *
  1456.      * @param \App\Entity\UserAdjustedTokenEntity $userAdjustedToken
  1457.      *
  1458.      * @return boolean TRUE if this collection contained the specified element, FALSE otherwise.
  1459.      */
  1460.     public function removeUserAdjustedToken(\App\Entity\UserAdjustedTokenEntity $userAdjustedToken)
  1461.     {
  1462.         return $this->userAdjustedTokens->removeElement($userAdjustedToken);
  1463.     }
  1464.     /**
  1465.      * Get userAdjustedTokens.
  1466.      *
  1467.      * @return \Doctrine\Common\Collections\Collection
  1468.      */
  1469.     public function getUserAdjustedTokens()
  1470.     {
  1471.         return $this->userAdjustedTokens;
  1472.     }
  1473.     /**
  1474.      * Add bannedUser.
  1475.      *
  1476.      * @param \App\Entity\BannedUserEntity $bannedUser
  1477.      *
  1478.      * @return UserEntity
  1479.      */
  1480.     public function addBannedUser(\App\Entity\BannedUserEntity $bannedUser)
  1481.     {
  1482.         $this->bannedUsers[] = $bannedUser;
  1483.         return $this;
  1484.     }
  1485.     /**
  1486.      * Remove bannedUser.
  1487.      *
  1488.      * @param \App\Entity\BannedUserEntity $bannedUser
  1489.      *
  1490.      * @return boolean TRUE if this collection contained the specified element, FALSE otherwise.
  1491.      */
  1492.     public function removeBannedUser(\App\Entity\BannedUserEntity $bannedUser)
  1493.     {
  1494.         return $this->bannedUsers->removeElement($bannedUser);
  1495.     }
  1496.     /**
  1497.      * Get bannedUsers.
  1498.      *
  1499.      * @return \Doctrine\Common\Collections\Collection
  1500.      */
  1501.     public function getBannedUsers()
  1502.     {
  1503.         return $this->bannedUsers;
  1504.     }
  1505.     /**
  1506.      * Set cloAddress.
  1507.      *
  1508.      * @param string|null $cloAddress
  1509.      *
  1510.      * @return UserEntity
  1511.      */
  1512.     public function setCloAddress($cloAddress null)
  1513.     {
  1514.         $this->cloAddress $cloAddress;
  1515.         return $this;
  1516.     }
  1517.     /**
  1518.      * Get cloAddress.
  1519.      *
  1520.      * @return string|null
  1521.      */
  1522.     public function getCloAddress()
  1523.     {
  1524.         return $this->cloAddress;
  1525.     }
  1526.     /**
  1527.      * Set kycStatus.
  1528.      *
  1529.      * @param string|null $kycStatus
  1530.      *
  1531.      * @return UserEntity
  1532.      */
  1533.     public function setKycStatus($kycStatus null)
  1534.     {
  1535.         $this->kycStatus $kycStatus;
  1536.         return $this;
  1537.     }
  1538.     /**
  1539.      * Get kycStatus.
  1540.      *
  1541.      * @return string|null
  1542.      */
  1543.     public function getKycStatus()
  1544.     {
  1545.         return $this->kycStatus;
  1546.     }
  1547.     /**
  1548.      * Set birthDate.
  1549.      *
  1550.      * @param string|null $birthDate
  1551.      *
  1552.      * @return UserEntity
  1553.      */
  1554.     public function setBirthDate($birthDate null)
  1555.     {
  1556.        $this->birthDate = empty($birthDate) ? null :  new \DateTime($birthDate);
  1557.         return $this;
  1558.     }
  1559.     /**
  1560.      * Get birthDate.
  1561.      *
  1562.      * @return string|null
  1563.      */
  1564.     public function getBirthDate()
  1565.     {
  1566.         return $this->birthDate;
  1567.     }
  1568.     /**
  1569.      * Set nationality.
  1570.      *
  1571.      * @param string|null $nationality
  1572.      *
  1573.      * @return UserEntity
  1574.      */
  1575.     public function setNationality($nationality null)
  1576.     {
  1577.         $this->nationality $nationality;
  1578.         return $this;
  1579.     }
  1580.     /**
  1581.      * Get nationality.
  1582.      *
  1583.      * @return string|null
  1584.      */
  1585.     public function getNationality()
  1586.     {
  1587.         return $this->nationality;
  1588.     }
  1589.     /**
  1590.      * Set address1.
  1591.      *
  1592.      * @param string|null $address1
  1593.      *
  1594.      * @return UserEntity
  1595.      */
  1596.     public function setAddress1($address1 null)
  1597.     {
  1598.         $this->address1 $address1;
  1599.         return $this;
  1600.     }
  1601.     /**
  1602.      * Get address1.
  1603.      *
  1604.      * @return string|null
  1605.      */
  1606.     public function getAddress1()
  1607.     {
  1608.         return $this->address1;
  1609.     }
  1610.     /**
  1611.      * Set address2.
  1612.      *
  1613.      * @param string|null $address2
  1614.      *
  1615.      * @return UserEntity
  1616.      */
  1617.     public function setAddress2($address2 null)
  1618.     {
  1619.         $this->address2 $address2;
  1620.         return $this;
  1621.     }
  1622.     /**
  1623.      * Get address2.
  1624.      *
  1625.      * @return string|null
  1626.      */
  1627.     public function getAddress2()
  1628.     {
  1629.         return $this->address2;
  1630.     }
  1631.     /**
  1632.      * Set city.
  1633.      *
  1634.      * @param string|null $city
  1635.      *
  1636.      * @return UserEntity
  1637.      */
  1638.     public function setCity($city null)
  1639.     {
  1640.         $this->city $city;
  1641.         return $this;
  1642.     }
  1643.     /**
  1644.      * Get city.
  1645.      *
  1646.      * @return string|null
  1647.      */
  1648.     public function getCity()
  1649.     {
  1650.         return $this->city;
  1651.     }
  1652.     /**
  1653.      * Set zipCode.
  1654.      *
  1655.      * @param string|null $zipCode
  1656.      *
  1657.      * @return UserEntity
  1658.      */
  1659.     public function setZipCode($zipCode null)
  1660.     {
  1661.         $this->zipCode $zipCode;
  1662.         return $this;
  1663.     }
  1664.     /**
  1665.      * Get zipCode.
  1666.      *
  1667.      * @return string|null
  1668.      */
  1669.     public function getZipCode()
  1670.     {
  1671.         return $this->zipCode;
  1672.     }
  1673.     /**
  1674.      * Set idFile.
  1675.      *
  1676.      * @param string|null $idFile
  1677.      *
  1678.      * @return UserEntity
  1679.      */
  1680.     public function setIdFile($idFile null)
  1681.     {
  1682.         $this->idFile $idFile;
  1683.         return $this;
  1684.     }
  1685.     /**
  1686.      * Get idFile.
  1687.      *
  1688.      * @return string|null
  1689.      */
  1690.     public function getIdFile()
  1691.     {
  1692.         return $this->idFile;
  1693.     }
  1694.     /**
  1695.      * Set idFileParse.
  1696.      *
  1697.      * @param string|null $idFileParse
  1698.      *
  1699.      * @return UserEntity
  1700.      */
  1701.     public function setIdFileParse($idFileParse null)
  1702.     {
  1703.         $this->idFileParse $idFileParse;
  1704.         return $this;
  1705.     }
  1706.     /**
  1707.      * Get idFileParse.
  1708.      *
  1709.      * @return string|null
  1710.      */
  1711.     public function getIdFileParse()
  1712.     {
  1713.         return $this->idFileParse;
  1714.     }
  1715.     /**
  1716.      * Set idType.
  1717.      *
  1718.      * @param string|null $idType
  1719.      *
  1720.      * @return UserEntity
  1721.      */
  1722.     public function setIdType($idType null)
  1723.     {
  1724.         $this->idType $idType;
  1725.         return $this;
  1726.     }
  1727.     /**
  1728.      * Get idType.
  1729.      *
  1730.      * @return string|null
  1731.      */
  1732.     public function getIdType()
  1733.     {
  1734.         return $this->idType;
  1735.     }
  1736.     /**
  1737.      * Set phoneNo.
  1738.      *
  1739.      * @param string|null $phoneNo
  1740.      *
  1741.      * @return UserEntity
  1742.      */
  1743.     public function setPhoneNo($phoneNo null)
  1744.     {
  1745.         $this->phoneNo $phoneNo;
  1746.         return $this;
  1747.     }
  1748.     /**
  1749.      * Get phoneNo.
  1750.      *
  1751.      * @return string|null
  1752.      */
  1753.     public function getPhoneNo()
  1754.     {
  1755.         return $this->phoneNo;
  1756.     }
  1757.     public function getAvatar(): ?string
  1758.     {
  1759.         return $this->avatar;
  1760.     }
  1761.     public function setAvatar(?string $avatar): self
  1762.     {
  1763.         $this->avatar $avatar;
  1764.         return $this;
  1765.     }
  1766.     public function getFbPageLink(): ?string
  1767.     {
  1768.         return $this->fbPageLink;
  1769.     }
  1770.     public function setFbPageLink(?string $fbPageLink): self
  1771.     {
  1772.         $this->fbPageLink $fbPageLink;
  1773.         return $this;
  1774.     }
  1775.     public function getTwitterPageLink(): ?string
  1776.     {
  1777.         return $this->twitterPageLink;
  1778.     }
  1779.     public function setTwitterPageLink(?string $twitterPageLink): self
  1780.     {
  1781.         $this->twitterPageLink $twitterPageLink;
  1782.         return $this;
  1783.     }
  1784.     public function getIgPageLink(): ?string
  1785.     {
  1786.         return $this->igPageLink;
  1787.     }
  1788.     public function setIgPageLink(?string $igPageLink): self
  1789.     {
  1790.         $this->igPageLink $igPageLink;
  1791.         return $this;
  1792.     }
  1793.     public function getCardNo(): ?string
  1794.     {
  1795.         return $this->cardNo;
  1796.     }
  1797.     public function setCardNo(?string $cardNo): self
  1798.     {
  1799.         $this->cardNo $cardNo;
  1800.         return $this;
  1801.     }
  1802.     /**
  1803.      * @return Collection|UserStakeTokenEntity[]
  1804.      */
  1805.     public function getUserStakeTokens(): Collection
  1806.     {
  1807.         return $this->userStakeTokens;
  1808.     }
  1809.     public function addUserStakeToken(UserStakeTokenEntity $userStakeToken): self
  1810.     {
  1811.         if (!$this->userStakeTokens->contains($userStakeToken)) {
  1812.             $this->userStakeTokens[] = $userStakeToken;
  1813.             $userStakeToken->setUser($this);
  1814.         }
  1815.         return $this;
  1816.     }
  1817.     public function removeUserStakeToken(UserStakeTokenEntity $userStakeToken): self
  1818.     {
  1819.         if ($this->userStakeTokens->removeElement($userStakeToken)) {
  1820.             // set the owning side to null (unless already changed)
  1821.             if ($userStakeToken->getUser() === $this) {
  1822.                 $userStakeToken->setUser(null);
  1823.             }
  1824.         }
  1825.         return $this;
  1826.     }
  1827.     public function isIsActive(): ?bool
  1828.     {
  1829.         return $this->isActive;
  1830.     }
  1831.     public function isHasFirstReferral(): ?bool
  1832.     {
  1833.         return $this->hasFirstReferral;
  1834.     }
  1835.     public function isHasEnabledTwoFa(): ?bool
  1836.     {
  1837.         return $this->hasEnabledTwoFa;
  1838.     }
  1839.     public function isTwoFa(): ?bool
  1840.     {
  1841.         return $this->twoFa;
  1842.     }
  1843.     public function getCountry(): ?string
  1844.     {
  1845.         return $this->country;
  1846.     }
  1847.     public function setCountry(?string $country): static
  1848.     {
  1849.         $this->country $country;
  1850.         return $this;
  1851.     }
  1852.     /**
  1853.      * @return Collection<int, UserEmailEntity>
  1854.      */
  1855.     public function getUserEmails(): Collection
  1856.     {
  1857.         return $this->userEmails;
  1858.     }
  1859.     public function addUserEmail(UserEmailEntity $userEmail): static
  1860.     {
  1861.         if (!$this->userEmails->contains($userEmail)) {
  1862.             $this->userEmails->add($userEmail);
  1863.             $userEmail->setUser($this);
  1864.         }
  1865.         return $this;
  1866.     }
  1867.     public function removeUserEmail(UserEmailEntity $userEmail): static
  1868.     {
  1869.         if ($this->userEmails->removeElement($userEmail)) {
  1870.             // set the owning side to null (unless already changed)
  1871.             if ($userEmail->getUser() === $this) {
  1872.                 $userEmail->setUser(null);
  1873.             }
  1874.         }
  1875.         return $this;
  1876.     }
  1877.     public function isIsNewsletterSubscriber(): ?bool
  1878.     {
  1879.         return $this->isNewsletterSubscriber;
  1880.     }
  1881.     public function setIsNewsletterSubscriber(bool $isNewsletterSubscriber): static
  1882.     {
  1883.         $this->isNewsletterSubscriber $isNewsletterSubscriber;
  1884.         return $this;
  1885.     }
  1886.     /**
  1887.      * @return Collection<int, UserMemeCoinEntity>
  1888.      */
  1889.     public function getUserMemeCoins(): Collection
  1890.     {
  1891.         return $this->userMemeCoins;
  1892.     }
  1893.     public function addUserMemeCoin(UserMemeCoinEntity $userMemeCoin): static
  1894.     {
  1895.         if (!$this->userMemeCoins->contains($userMemeCoin)) {
  1896.             $this->userMemeCoins->add($userMemeCoin);
  1897.             $userMemeCoin->setUser($this);
  1898.         }
  1899.         return $this;
  1900.     }
  1901.     public function removeUserMemeCoin(UserMemeCoinEntity $userMemeCoin): static
  1902.     {
  1903.         if ($this->userMemeCoins->removeElement($userMemeCoin)) {
  1904.             // set the owning side to null (unless already changed)
  1905.             if ($userMemeCoin->getUser() === $this) {
  1906.                 $userMemeCoin->setUser(null);
  1907.             }
  1908.         }
  1909.         return $this;
  1910.     }
  1911.     /**
  1912.      * @return Collection<int, UserMemeCoinTransactionEntity>
  1913.      */
  1914.     public function getUserMemeCoinTransactionBuyers(): Collection
  1915.     {
  1916.         return $this->userMemeCoinTransactionBuyers;
  1917.     }
  1918.     public function addUserMemeCoinTransactionBuyer(UserMemeCoinTransactionEntity $userMemeCoinTransactionBuyer): static
  1919.     {
  1920.         if (!$this->userMemeCoinTransactionBuyers->contains($userMemeCoinTransactionBuyer)) {
  1921.             $this->userMemeCoinTransactionBuyers->add($userMemeCoinTransactionBuyer);
  1922.             $userMemeCoinTransactionBuyer->setBuyer($this);
  1923.         }
  1924.         return $this;
  1925.     }
  1926.     public function removeUserMemeCoinTransactionBuyer(UserMemeCoinTransactionEntity $userMemeCoinTransactionBuyer): static
  1927.     {
  1928.         if ($this->userMemeCoinTransactionBuyers->removeElement($userMemeCoinTransactionBuyer)) {
  1929.             // set the owning side to null (unless already changed)
  1930.             if ($userMemeCoinTransactionBuyer->getBuyer() === $this) {
  1931.                 $userMemeCoinTransactionBuyer->setBuyer(null);
  1932.             }
  1933.         }
  1934.         return $this;
  1935.     }
  1936.     /**
  1937.      * @return Collection<int, UserMemeCoinTransactionEntity>
  1938.      */
  1939.     public function getUserMemeCoinTransactionSellers(): Collection
  1940.     {
  1941.         return $this->userMemeCoinTransactionSellers;
  1942.     }
  1943.     public function addUserMemeCoinTransactionSeller(UserMemeCoinTransactionEntity $userMemeCoinTransactionSeller): static
  1944.     {
  1945.         if (!$this->userMemeCoinTransactionSellers->contains($userMemeCoinTransactionSeller)) {
  1946.             $this->userMemeCoinTransactionSellers->add($userMemeCoinTransactionSeller);
  1947.             $userMemeCoinTransactionSeller->setSeller($this);
  1948.         }
  1949.         return $this;
  1950.     }
  1951.     public function removeUserMemeCoinTransactionSeller(UserMemeCoinTransactionEntity $userMemeCoinTransactionSeller): static
  1952.     {
  1953.         if ($this->userMemeCoinTransactionSellers->removeElement($userMemeCoinTransactionSeller)) {
  1954.             // set the owning side to null (unless already changed)
  1955.             if ($userMemeCoinTransactionSeller->getSeller() === $this) {
  1956.                 $userMemeCoinTransactionSeller->setSeller(null);
  1957.             }
  1958.         }
  1959.         return $this;
  1960.     }
  1961. }