<?php
namespace App\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Form\Extension\Core\DataTransformer\DateTimeToStringTransformer;
/**
* @ORM\Entity(repositoryClass="App\Repository\UserRepository")
* @ORM\Table(name="user")
* @ORM\HasLifecycleCallbacks()
*/
class UserEntity
{
/**
* @ORM\Column(type="bigint")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
/**
* @ORM\Column(type="string")
*/
protected $password;
/**
* @ORM\Column(name="forgot_password_code", type="string", nullable=true)
*/
protected $forgotPasswordCode;
/**
* @ORM\Column(type="string")
*/
protected $type;
/**
* @ORM\Column(name="is_active", type="boolean")
*/
protected $isActive;
/**
* @ORM\Column(name="has_first_referral", type="boolean")
*/
protected $hasFirstReferral;
/**
* @ORM\Column(name="has_enabled_two_fa", type="boolean")
*/
protected $hasEnabledTwoFa;
/**
* @ORM\Column(name="is_newsletter_subscriber", type="boolean", nullable=true)
*/
protected $isNewsletterSubscriber;
/**
* @ORM\Column(name="two_fa", type="boolean")
*/
protected $twoFa;
/**
* @ORM\Column(name="two_fa_code", type="string", nullable=true)
*/
protected $twoFaCode;
/**
* @ORM\Column(name="status", type="string")
*/
protected $status;
/**
* @ORM\Column(name="first_name", type="string", nullable=true)
*/
protected $firstName;
/**
* @ORM\Column(name="last_name", type="string", nullable=true)
*/
protected $lastName;
/**
* @ORM\Column(name="email", type="string")
*/
protected $email;
/**
* @ORM\Column(name="token", type="string")
*/
protected $token;
/**
* @ORM\Column(name="referral_code", type="string", nullable=true)
*/
protected $referralCode;
/**
* @ORM\Column(name="exchange_phrase", type="string", nullable=true)
*/
protected $exchangePhrase;
/**
* @ORM\Column(name="ip_address", type="string", nullable=true)
*/
protected $ipAddress;
/**
* @ORM\Column(name="clo_address", type="string", nullable=true)
*/
protected $cloAddress;
/**
* @ORM\Column(name="wallet_address", type="string", nullable=true)
*/
protected $walletAddress;
/**
* @ORM\Column(name="kyc_status", type="string", nullable=true)
*/
protected $kycStatus;
/**
* @ORM\Column(name="birth_date", type="datetime", nullable=true)
*/
protected $birthDate;
/**
* @ORM\Column(name="phone_no", type="string", nullable=true)
*/
protected $phoneNo;
/**
* @ORM\Column(name="nationality", type="string", nullable=true)
*/
protected $nationality;
/**
* @ORM\Column(name="address1", type="string", nullable=true)
*/
protected $address1;
/**
* @ORM\Column(name="address2", type="string", nullable=true)
*/
protected $address2;
/**
* @ORM\Column(name="city", type="string", nullable=true)
*/
protected $city;
/**
* @ORM\Column(name="zip_code", type="string", nullable=true)
*/
protected $zipCode;
/**
* @ORM\Column(name="fb_page_link", type="string", nullable=true)
*/
protected $fbPageLink;
/**
* @ORM\Column(name="twitter_page_link", type="string", nullable=true)
*/
protected $twitterPageLink;
/**
* @ORM\Column(name="ig_page_link", type="string", nullable=true)
*/
protected $igPageLink;
/**
* @ORM\Column(name="id_file", type="string", nullable=true)
*/
protected $idFile;
/**
* @ORM\Column(name="id_file_parse", type="string", nullable=true)
*/
protected $idFileParse;
/**
* @ORM\Column(name="id_type", type="string", nullable=true)
*/
protected $idType;
/**
* @ORM\Column(name="avatar", type="string", nullable=true)
*/
protected $avatar;
/**
* @ORM\Column(name="card_no", type="string", nullable=true)
*/
protected $cardNo;
/**
* @ORM\Column(name="country", type="string", nullable=true)
*/
protected $country;
/**
* @ORM\Column(name="created_by", type="string", length=50)
*/
protected $createdBy;
/**
* @ORM\Column(name="created_at", type="datetime")
*/
protected $createdAt;
/**
* @ORM\Column(name="updated_by", type="string", length=50)
*/
protected $updatedBy;
/**
* @ORM\Column(name="updated_at", type="datetime")
*/
protected $updatedAt;
/**
* @ORM\OneToOne(targetEntity="ReferralEntity", inversedBy="referrent")
* @ORM\JoinColumn(name="referral_id", referencedColumnName="id")
*/
protected $referral;
/**
* @ORM\OneToMany(targetEntity="UserOrderTokenEntity", mappedBy="user", cascade={"remove"})
* @ORM\OrderBy({"createdAt": "DESC"})
*/
protected $userOrderTokens;
/**
* @ORM\OneToMany(targetEntity="ReferralEntity", mappedBy="referrer", cascade={"remove"})
*/
protected $referrals;
/**
* @ORM\OneToMany(targetEntity="UserBonusTokenEntity", mappedBy="user", cascade={"remove"})
* @ORM\OrderBy({"createdAt": "ASC"})
*/
protected $userBonusTokens;
/**
* @ORM\OneToMany(targetEntity="SupportTicketEntity", mappedBy="user", cascade={"remove"})
*/
protected $supportTickets;
/**
* @ORM\OneToMany(targetEntity="SupportTicketResponseEntity", mappedBy="user", cascade={"remove"})
*/
protected $supportTicketResponses;
/**
* @ORM\OneToMany(targetEntity="NotificationEntity", mappedBy="user", cascade={"remove"})
*/
protected $notifications;
/**
* @ORM\OneToMany(targetEntity="UserAdjustedTokenEntity", mappedBy="user", cascade={"remove"})
*/
protected $userAdjustedTokens;
/**
* @ORM\OneToMany(targetEntity="BannedUserEntity", mappedBy="user", cascade={"remove"})
*/
protected $bannedUsers;
/**
* @ORM\OneToMany(targetEntity="UserStakeTokenEntity", mappedBy="user", cascade={"remove"})
*/
protected $userStakeTokens;
/**
* @ORM\OneToMany(targetEntity="UserEmailEntity", mappedBy="user", cascade={"remove"})
*/
protected $userEmails;
/**
* Set createdAt
*
* @ORM\PrePersist
*/
public function setCreatedAtValue()
{
$this->createdBy = isset($_COOKIE['username']) ? $_COOKIE['username'] : 'System';
$this->createdAt = new \DateTime();
$this->updatedBy = isset($_COOKIE['username']) ? $_COOKIE['username'] : 'System';
$this->updatedAt = new \DateTime();
$this->status = "For Verification";
$this->isActive = true;
$this->twoFa = false;
$this->isNewsLetterSubscriber = false;
$this->hasFirstReferral = false;
$this->hasEnabledTwoFa = false;
$this->kycStatus = 'For-Application';
}
/**
* Set updatedAt
*
* @ORM\PreUpdate
*/
public function setUpdatedAtValue()
{
$this->updatedBy = isset($_COOKIE['username']) ? $_COOKIE['username'] : 'System';
$this->updatedAt = new \DateTime();
}
/**
* Remove the file from the disk
*
* @ORM\PreRemove
*/
public function removeFile() {
$file = $this->getUploadRootDir() . '/' . $this->idFileParse;
if(!empty($this->idFileParse) && file_exists($file)) unlink($file);
}
/**
* Get uploadDir
*
* @return string
*/
public function getUploadDir() {
return '/uploads/file';
}
/**
* Get uploadRootDir
*
* @return string
*/
public function getUploadRootDir() {
return __DIR__ . './../../public' . $this->getUploadDir();
}
/**
* get fileWebPath
*
* @return string
*/
public function getFileWebPath() {
$parsedDesc = $this->idFileParse;
$file = $this->getUploadRootDir() . '/' . $parsedDesc;
if(!empty($parsedDesc) ) {
return $this->getUploadDir() . '/' . $parsedDesc;
} else {
return '';
}
}
public function __construct($data = null)
{
if (!is_null($data)) {
$this->userOrderTokens = new ArrayCollection();
$this->userBonusTokens = new ArrayCollection();
$this->userAdjustedTokens = new ArrayCollection();
$this->bannedUsers = new ArrayCollection();
}
$this->referrals = new ArrayCollection();
$this->supportTickets = new ArrayCollection();
$this->supportTicketResponses = new ArrayCollection();
$this->notifications = new ArrayCollection();
$this->userStakeTokens = new ArrayCollection();
$this->userEmails = new ArrayCollection();
}
/**
* Get fullName
*
* @return string
*/
public function getFullName()
{
return $this->firstName .' ' . $this->lastName;
}
/**
* Get parsedCardNo
*
* @return string
*/
public function getParsedCardNo()
{
return wordwrap($this->cardNo , 4 , ' ' , true );
}
/**
* Get pinNo
*
* @return string
*/
public function getPinNo()
{
return str_pad($this->id, 9, "0", STR_PAD_RIGHT); ;
}
/**
* Get totalBalance
*
* @return string
*/
public function totalBalance() {
$balance = 0;
foreach ($this->userOrderTokens as $order){
if($order->getStatus() == 'Completed'){
$balance += $order->getTokenAmount();
}
}
foreach ($this->userBonusTokens as $bonus){
$balance += $bonus->getAmount();
}
foreach ($this->userAdjustedTokens as $token){
$balance += $token->getAmount();
}
foreach ($this->userStakeTokens as $token){
if($token->getStatus() == 'On Staking'){
$balance -= $token->getTokenAmount();
}
}
return $balance;
}
/**
* Get totalStakeReward
*
* @return string
*/
public function totalStakeReward() {
$balance = 0;
foreach ($this->userStakeTokens as $token){
if($token->getStatus() == 'Completed'){
$balance += $token->getInterest();
}
}
return $balance;
}
/**
* Get totalStakeBalance
*
* @return string
*/
public function totalStakeBalance() {
$balance = 0;
foreach ($this->userOrderTokens as $order){
if($order->getStatus() == 'Completed'){
$balance += $order->getTokenAmount();
}
}
foreach ($this->userBonusTokens as $bonus){
$balance += $bonus->getAmount();
}
foreach ($this->userAdjustedTokens as $token){
$balance += $token->getAmount();
}
foreach ($this->userStakeTokens as $token){
$balance -= $token->getTokenAmount();
}
return $balance;
}
/**
* Get totalOnStakeBalance
*
* @return string
*/
public function totalOnStakeBalance() {
$balance = 0;
foreach ($this->userStakeTokens as $token){
if($token->getStatus() == 'On Staking'){
$balance += $token->getTokenAmount();
}
}
return $balance;
}
public function getTotalReferrals()
{
$qb = $this->createQueryBuilder('r');
$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');
return $qb->getQuery()->getResult();
}
public function totalreferrallist($user, array $get){
$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`;");
$query = $this->getEntityManager()->getConnection()->prepare("
LEFT JOIN
SELECT COUNT(r.`id`) AS totalReferral, r.`referrer_id` FROM `referral` r WHERE r.`status` = 'Completed' GROUP BY r.`referrer_id`;
");
$query->execute($stmtParams);
$result = $query->fetchAll();
return !empty($result) ? $result[0]['totalreferrallist'] : 0;
}
/**
* Get totalPurchase
*
* @return int
*/
public function getTotalPurchase() {
$balance = 0;
foreach ($this->userOrderTokens as $order){
if($order->getStatus() == 'Completed'){
$balance += $order->getTokenAmount();
}
}
return $balance;
}
/**
* Get totalBonus
*
* @return int
*/
public function getTotalBonus() {
$balance = 0;
foreach ($this->userBonusTokens as $bonus){
$balance += $bonus->getAmount();
}
return $balance;
}
/**
* Get septTotalBalance
*
* @return string
*/
public function septTotalBalance() {
$balance = 0;
$d1 = new \DateTime('2022-09-30 24:59:59');
foreach ($this->userOrderTokens as $order){
if($order->getStatus() == 'Completed'){
if($order->getUpdatedAt() <= $d1){
$balance += $order->getTokenAmount();
}
}
}
foreach ($this->userBonusTokens as $bonus){
if($bonus->getUpdatedAt() <= $d1){
$balance += $bonus->getAmount();
}
}
foreach ($this->userAdjustedTokens as $token){
if($token->getUpdatedAt() <= $d1){
$balance += $token->getAmount();
}
}
return $balance;
}
/**
* Get hasTaskTokens
*
* @return boolean
*/
public function hasTaskTokens() {
$balance = 0;
foreach ($this->userOrderTokens as $order){
if($order->getStatus() == 'Completed'){
$balance += $order->getTokenAmount();
}
}
foreach ($this->userBonusTokens as $bonus){
$balance += $bonus->getAmount();
}
foreach ($this->userAdjustedTokens as $token){
$balance += $token->getAmount();
}
return $balance >= 100000 ? true : false ;
}
/**
* Get btcContribution
*
* @return string
*/
public function btcContribution() {
$ctr = 0;
foreach ($this->userOrderTokens as $order){
if($order->getStatus() == 'Completed' && $order->getNetwork() == 'BTC' ){
$ctr += $order->getTokenValue();
}
}
return $ctr;
}
/**
* Get ltcContribution
*0
* @return string
*/
public function ltcContribution() {
$ctr = 0;
foreach ($this->userOrderTokens as $order){
if($order->getStatus() == 'Completed' && $order->getNetwork() == 'LTC' ){
$ctr += $order->getAmount();
}
}
return $ctr;
}
/**
* Get dogeContribution
*0
* @return string
*/
public function dogeContribution() {
$ctr = 0;
foreach ($this->userOrderTokens as $order){
if($order->getStatus() == 'Completed' && $order->getNetwork() == 'DOGE' ){
$ctr += $order->getAmount();
}
}
return $ctr;
}
/**
* Get ethContribution
*0
* @return string
*/
public function ethContribution() {
$ctr = 0;
foreach ($this->userOrderTokens as $order){
if($order->getStatus() == 'Completed' && $order->getNetwork() == 'ETH' ){
$ctr += $order->getTokenValue();
}
}
return $ctr;
}
/**
* Get bnbContribution
*0
* @return string
*/
public function bnbContribution() {
$ctr = 0;
foreach ($this->userOrderTokens as $order){
if($order->getStatus() == 'Completed' && $order->getNetwork() == 'BNB' ){
$ctr += $order->getTokenValue();
}
}
return $ctr;
}
/**
* Get referralCtr
*
* @return string
*/
public function getReferralCtr() {
return count($this->getReferrals());
}
/*--------------------------------------------------------------------------------------------------------*/
/* Defined Setters and Getters */
/*--------------------------------------------------------------------------------------------------------*/
/**
* Get id.
*
* @return int
*/
public function getId()
{
return $this->id;
}
/**
* Set password.
*
* @param string $password
*
* @return UserEntity
*/
public function setPassword($password)
{
$this->password = $password;
return $this;
}
/**
* Get password.
*
* @return string
*/
public function getPassword()
{
return $this->password;
}
/**
* Set type.
*
* @param string $type
*
* @return UserEntity
*/
public function setType($type)
{
$this->type = $type;
return $this;
}
/**
* Get type.
*
* @return string
*/
public function getType()
{
return $this->type;
}
/**
* Set isActive.
*
* @param bool $isActive
*
* @return UserEntity
*/
public function setIsActive($isActive)
{
$this->isActive = $isActive;
return $this;
}
/**
* Get isActive.
*
* @return bool
*/
public function getIsActive()
{
return $this->isActive;
}
/**
* Set firstName.
*
* @param string|null $firstName
*
* @return UserEntity
*/
public function setFirstName($firstName = null)
{
$this->firstName = $firstName;
return $this;
}
/**
* Get firstName.
*
* @return string|null
*/
public function getFirstName()
{
return $this->firstName;
}
/**
* Set lastName.
*
* @param string|null $lastName
*
* @return UserEntity
*/
public function setLastName($lastName = null)
{
$this->lastName = $lastName;
return $this;
}
/**
* Get lastName.
*
* @return string|null
*/
public function getLastName()
{
return $this->lastName;
}
/**
* Set email.
*
* @param string $email
*
* @return UserEntity
*/
public function setEmail($email)
{
$this->email = $email;
return $this;
}
/**
* Get email.
*
* @return string
*/
public function getEmail()
{
return $this->email;
}
/**
* Set createdBy.
*
* @param string $createdBy
*
* @return UserEntity
*/
public function setCreatedBy($createdBy)
{
$this->createdBy = $createdBy;
return $this;
}
/**
* Get createdBy.
*
* @return string
*/
public function getCreatedBy()
{
return $this->createdBy;
}
/**
* Set createdAt.
*
* @param \DateTime $createdAt
*
* @return UserEntity
*/
public function setCreatedAt($createdAt)
{
$this->createdAt = $createdAt;
return $this;
}
/**
* Get createdAt.
*
* @return \DateTime
*/
public function getCreatedAt()
{
return $this->createdAt;
}
/**
* Set updatedBy.
*
* @param string $updatedBy
*
* @return UserEntity
*/
public function setUpdatedBy($updatedBy)
{
$this->updatedBy = $updatedBy;
return $this;
}
/**
* Get updatedBy.
*
* @return string
*/
public function getUpdatedBy()
{
return $this->updatedBy;
}
/**
* Set updatedAt.
*
* @param \DateTime $updatedAt
*
* @return UserEntity
*/
public function setUpdatedAt($updatedAt)
{
$this->updatedAt = $updatedAt;
return $this;
}
/**
* Get updatedAt.
*
* @return \DateTime
*/
public function getUpdatedAt()
{
return $this->updatedAt;
}
/**
* Set status.
*
* @param bool $status
*
* @return UserEntity
*/
public function setStatus($status)
{
$this->status = $status;
return $this;
}
/**
* Get status.
*
* @return bool
*/
public function getStatus()
{
return $this->status;
}
/**
* Add userOrderToken.
*
* @param \App\Entity\UserOrderTokenEntity $userOrderToken
*
* @return UserEntity
*/
public function addUserOrderToken(\App\Entity\UserOrderTokenEntity $userOrderToken)
{
$this->userOrderTokens[] = $userOrderToken;
return $this;
}
/**
* Remove userOrderToken.
*
* @param \App\Entity\UserOrderTokenEntity $userOrderToken
*
* @return boolean TRUE if this collection contained the specified element, FALSE otherwise.
*/
public function removeUserOrderToken(\App\Entity\UserOrderTokenEntity $userOrderToken)
{
return $this->userOrderTokens->removeElement($userOrderToken);
}
/**
* Get userOrderTokens.
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getUserOrderTokens()
{
return $this->userOrderTokens;
}
/**
* Add referral.
*
* @param \App\Entity\ReferralEntity $referral
*
* @return UserEntity
*/
public function addReferral(\App\Entity\ReferralEntity $referral)
{
$this->referrals[] = $referral;
return $this;
}
/**
* Remove referral.
*
* @param \App\Entity\ReferralEntity $referral
*
* @return boolean TRUE if this collection contained the specified element, FALSE otherwise.
*/
public function removeReferral(\App\Entity\ReferralEntity $referral)
{
return $this->referrals->removeElement($referral);
}
/**
* Get referrals.
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getReferrals()
{
return $this->referrals;
}
/**
* Add userBonusToken.
*
* @param \App\Entity\UserBonusTokenEntity $userBonusToken
*
* @return UserEntity
*/
public function addUserBonusToken(\App\Entity\UserBonusTokenEntity $userBonusToken)
{
$this->userBonusTokens[] = $userBonusToken;
return $this;
}
/**
* Remove userBonusToken.
*
* @param \App\Entity\UserBonusTokenEntity $userBonusToken
*
* @return boolean TRUE if this collection contained the specified element, FALSE otherwise.
*/
public function removeUserBonusToken(\App\Entity\UserBonusTokenEntity $userBonusToken)
{
return $this->userBonusTokens->removeElement($userBonusToken);
}
/**
* Get userBonusTokens.
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getUserBonusTokens()
{
return $this->userBonusTokens;
}
/**
* Set referral.
*
* @param \App\Entity\ReferralEntity|null $referral
*
* @return UserEntity
*/
public function setReferral(\App\Entity\ReferralEntity $referral = null)
{
$this->referral = $referral;
return $this;
}
/**
* Get referral.
*
* @return \App\Entity\ReferralEntity|null
*/
public function getReferral()
{
return $this->referral;
}
/**
* Set referralCode.
*
* @param string|null $referralCode
*
* @return UserEntity
*/
public function setReferralCode($referralCode = null)
{
$this->referralCode = $referralCode;
return $this;
}
/**
* Get referralCode.
*
* @return string|null
*/
public function getReferralCode()
{
return $this->referralCode;
}
/**
* Set token.
*
* @param string $token
*
* @return UserEntity
*/
public function setToken($token)
{
$this->token = $token;
return $this;
}
/**
* Get token.
*
* @return string
*/
public function getToken()
{
return $this->token;
}
/**
* Add supportTicket.
*
* @param \App\Entity\SupportTicketEntity $supportTicket
*
* @return UserEntity
*/
public function addSupportTicket(\App\Entity\SupportTicketEntity $supportTicket)
{
$this->supportTickets[] = $supportTicket;
return $this;
}
/**
* Remove supportTicket.
*
* @param \App\Entity\SupportTicketEntity $supportTicket
*
* @return boolean TRUE if this collection contained the specified element, FALSE otherwise.
*/
public function removeSupportTicket(\App\Entity\SupportTicketEntity $supportTicket)
{
return $this->supportTickets->removeElement($supportTicket);
}
/**
* Get supportTickets.
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getSupportTickets()
{
return $this->supportTickets;
}
/**
* Add supportTicketResponse.
*
* @param \App\Entity\SupportTicketResponseEntity $supportTicketResponse
*
* @return UserEntity
*/
public function addSupportTicketResponse(\App\Entity\SupportTicketResponseEntity $supportTicketResponse)
{
$this->supportTicketResponses[] = $supportTicketResponse;
return $this;
}
/**
* Remove supportTicketResponse.
*
* @param \App\Entity\SupportTicketResponseEntity $supportTicketResponse
*
* @return boolean TRUE if this collection contained the specified element, FALSE otherwise.
*/
public function removeSupportTicketResponse(\App\Entity\SupportTicketResponseEntity $supportTicketResponse)
{
return $this->supportTicketResponses->removeElement($supportTicketResponse);
}
/**
* Get supportTicketResponses.
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getSupportTicketResponses()
{
return $this->supportTicketResponses;
}
/**
* Set exchangePhrase.
*
* @param string|null $exchangePhrase
*
* @return UserEntity
*/
public function setExchangePhrase($exchangePhrase = null)
{
$this->exchangePhrase = $exchangePhrase;
return $this;
}
/**
* Get exchangePhrase.
*
* @return string|null
*/
public function getExchangePhrase()
{
return $this->exchangePhrase;
}
/**
* Set walletAddress.
*
* @param string|null $walletAddress
*
* @return UserEntity
*/
public function setWalletAddress($walletAddress = null)
{
$this->walletAddress = $walletAddress;
return $this;
}
/**
* Get walletAddress.
*
* @return string|null
*/
public function getWalletAddress()
{
return $this->walletAddress;
}
/**
* Add notification.
*
* @param \App\Entity\NotificationEntity $notification
*
* @return UserEntity
*/
public function addNotification(\App\Entity\NotificationEntity $notification)
{
$this->notifications[] = $notification;
return $this;
}
/**
* Remove notification.
*
* @param \App\Entity\NotificationEntity $notification
*
* @return boolean TRUE if this collection contained the specified element, FALSE otherwise.
*/
public function removeNotification(\App\Entity\NotificationEntity $notification)
{
return $this->notifications->removeElement($notification);
}
/**
* Get notifications.
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getNotifications()
{
return $this->notifications;
}
/**
* Set ipAddress.
*
* @param string|null $ipAddress
*
* @return UserEntity
*/
public function setIpAddress($ipAddress = null)
{
$this->ipAddress = $ipAddress;
return $this;
}
/**
* Get ipAddress.
*
* @return string|null
*/
public function getIpAddress()
{
return $this->ipAddress;
}
/**
* Set forgotPasswordCode.
*
* @param string $forgotPasswordCode
*
* @return UserEntity
*/
public function setForgotPasswordCode($forgotPasswordCode)
{
$this->forgotPasswordCode = $forgotPasswordCode;
return $this;
}
/**
* Get forgotPasswordCode.
*
* @return string
*/
public function getForgotPasswordCode()
{
return $this->forgotPasswordCode;
}
/**
* Set twoFa.
*
* @param bool $twoFa
*
* @return UserEntity
*/
public function setTwoFa($twoFa)
{
$this->twoFa = $twoFa;
return $this;
}
/**
* Get twoFa.
*
* @return bool
*/
public function getTwoFa()
{
return $this->twoFa;
}
/**
* Set twoFaCode.
*
* @param string|null $twoFaCode
*
* @return UserEntity
*/
public function setTwoFaCode($twoFaCode = null)
{
$this->twoFaCode = $twoFaCode;
return $this;
}
/**
* Get twoFaCode.
*
* @return string|null
*/
public function getTwoFaCode()
{
return $this->twoFaCode;
}
/**
* Set hasFirstReferral.
*
* @param bool $hasFirstReferral
*
* @return UserEntity
*/
public function setHasFirstReferral($hasFirstReferral)
{
$this->hasFirstReferral = $hasFirstReferral;
return $this;
}
/**
* Get hasFirstReferral.
*
* @return bool
*/
public function getHasFirstReferral()
{
return $this->hasFirstReferral;
}
/**
* Set hasEnabledTwoFa.
*
* @param bool $hasEnabledTwoFa
*
* @return UserEntity
*/
public function setHasEnabledTwoFa($hasEnabledTwoFa)
{
$this->hasEnabledTwoFa = $hasEnabledTwoFa;
return $this;
}
/**
* Get hasEnabledTwoFa.
*
* @return bool
*/
public function getHasEnabledTwoFa()
{
return $this->hasEnabledTwoFa;
}
/**
* Add userAdjustedToken.
*
* @param \App\Entity\UserAdjustedTokenEntity $userAdjustedToken
*
* @return UserEntity
*/
public function addUserAdjustedToken(\App\Entity\UserAdjustedTokenEntity $userAdjustedToken)
{
$this->userAdjustedTokens[] = $userAdjustedToken;
return $this;
}
/**
* Remove userAdjustedToken.
*
* @param \App\Entity\UserAdjustedTokenEntity $userAdjustedToken
*
* @return boolean TRUE if this collection contained the specified element, FALSE otherwise.
*/
public function removeUserAdjustedToken(\App\Entity\UserAdjustedTokenEntity $userAdjustedToken)
{
return $this->userAdjustedTokens->removeElement($userAdjustedToken);
}
/**
* Get userAdjustedTokens.
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getUserAdjustedTokens()
{
return $this->userAdjustedTokens;
}
/**
* Add bannedUser.
*
* @param \App\Entity\BannedUserEntity $bannedUser
*
* @return UserEntity
*/
public function addBannedUser(\App\Entity\BannedUserEntity $bannedUser)
{
$this->bannedUsers[] = $bannedUser;
return $this;
}
/**
* Remove bannedUser.
*
* @param \App\Entity\BannedUserEntity $bannedUser
*
* @return boolean TRUE if this collection contained the specified element, FALSE otherwise.
*/
public function removeBannedUser(\App\Entity\BannedUserEntity $bannedUser)
{
return $this->bannedUsers->removeElement($bannedUser);
}
/**
* Get bannedUsers.
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getBannedUsers()
{
return $this->bannedUsers;
}
/**
* Set cloAddress.
*
* @param string|null $cloAddress
*
* @return UserEntity
*/
public function setCloAddress($cloAddress = null)
{
$this->cloAddress = $cloAddress;
return $this;
}
/**
* Get cloAddress.
*
* @return string|null
*/
public function getCloAddress()
{
return $this->cloAddress;
}
/**
* Set kycStatus.
*
* @param string|null $kycStatus
*
* @return UserEntity
*/
public function setKycStatus($kycStatus = null)
{
$this->kycStatus = $kycStatus;
return $this;
}
/**
* Get kycStatus.
*
* @return string|null
*/
public function getKycStatus()
{
return $this->kycStatus;
}
/**
* Set birthDate.
*
* @param string|null $birthDate
*
* @return UserEntity
*/
public function setBirthDate($birthDate = null)
{
$this->birthDate = empty($birthDate) ? null : new \DateTime($birthDate);
return $this;
}
/**
* Get birthDate.
*
* @return string|null
*/
public function getBirthDate()
{
return $this->birthDate;
}
/**
* Set nationality.
*
* @param string|null $nationality
*
* @return UserEntity
*/
public function setNationality($nationality = null)
{
$this->nationality = $nationality;
return $this;
}
/**
* Get nationality.
*
* @return string|null
*/
public function getNationality()
{
return $this->nationality;
}
/**
* Set address1.
*
* @param string|null $address1
*
* @return UserEntity
*/
public function setAddress1($address1 = null)
{
$this->address1 = $address1;
return $this;
}
/**
* Get address1.
*
* @return string|null
*/
public function getAddress1()
{
return $this->address1;
}
/**
* Set address2.
*
* @param string|null $address2
*
* @return UserEntity
*/
public function setAddress2($address2 = null)
{
$this->address2 = $address2;
return $this;
}
/**
* Get address2.
*
* @return string|null
*/
public function getAddress2()
{
return $this->address2;
}
/**
* Set city.
*
* @param string|null $city
*
* @return UserEntity
*/
public function setCity($city = null)
{
$this->city = $city;
return $this;
}
/**
* Get city.
*
* @return string|null
*/
public function getCity()
{
return $this->city;
}
/**
* Set zipCode.
*
* @param string|null $zipCode
*
* @return UserEntity
*/
public function setZipCode($zipCode = null)
{
$this->zipCode = $zipCode;
return $this;
}
/**
* Get zipCode.
*
* @return string|null
*/
public function getZipCode()
{
return $this->zipCode;
}
/**
* Set idFile.
*
* @param string|null $idFile
*
* @return UserEntity
*/
public function setIdFile($idFile = null)
{
$this->idFile = $idFile;
return $this;
}
/**
* Get idFile.
*
* @return string|null
*/
public function getIdFile()
{
return $this->idFile;
}
/**
* Set idFileParse.
*
* @param string|null $idFileParse
*
* @return UserEntity
*/
public function setIdFileParse($idFileParse = null)
{
$this->idFileParse = $idFileParse;
return $this;
}
/**
* Get idFileParse.
*
* @return string|null
*/
public function getIdFileParse()
{
return $this->idFileParse;
}
/**
* Set idType.
*
* @param string|null $idType
*
* @return UserEntity
*/
public function setIdType($idType = null)
{
$this->idType = $idType;
return $this;
}
/**
* Get idType.
*
* @return string|null
*/
public function getIdType()
{
return $this->idType;
}
/**
* Set phoneNo.
*
* @param string|null $phoneNo
*
* @return UserEntity
*/
public function setPhoneNo($phoneNo = null)
{
$this->phoneNo = $phoneNo;
return $this;
}
/**
* Get phoneNo.
*
* @return string|null
*/
public function getPhoneNo()
{
return $this->phoneNo;
}
public function getAvatar(): ?string
{
return $this->avatar;
}
public function setAvatar(?string $avatar): self
{
$this->avatar = $avatar;
return $this;
}
public function getFbPageLink(): ?string
{
return $this->fbPageLink;
}
public function setFbPageLink(?string $fbPageLink): self
{
$this->fbPageLink = $fbPageLink;
return $this;
}
public function getTwitterPageLink(): ?string
{
return $this->twitterPageLink;
}
public function setTwitterPageLink(?string $twitterPageLink): self
{
$this->twitterPageLink = $twitterPageLink;
return $this;
}
public function getIgPageLink(): ?string
{
return $this->igPageLink;
}
public function setIgPageLink(?string $igPageLink): self
{
$this->igPageLink = $igPageLink;
return $this;
}
public function getCardNo(): ?string
{
return $this->cardNo;
}
public function setCardNo(?string $cardNo): self
{
$this->cardNo = $cardNo;
return $this;
}
/**
* @return Collection|UserStakeTokenEntity[]
*/
public function getUserStakeTokens(): Collection
{
return $this->userStakeTokens;
}
public function addUserStakeToken(UserStakeTokenEntity $userStakeToken): self
{
if (!$this->userStakeTokens->contains($userStakeToken)) {
$this->userStakeTokens[] = $userStakeToken;
$userStakeToken->setUser($this);
}
return $this;
}
public function removeUserStakeToken(UserStakeTokenEntity $userStakeToken): self
{
if ($this->userStakeTokens->removeElement($userStakeToken)) {
// set the owning side to null (unless already changed)
if ($userStakeToken->getUser() === $this) {
$userStakeToken->setUser(null);
}
}
return $this;
}
public function isIsActive(): ?bool
{
return $this->isActive;
}
public function isHasFirstReferral(): ?bool
{
return $this->hasFirstReferral;
}
public function isHasEnabledTwoFa(): ?bool
{
return $this->hasEnabledTwoFa;
}
public function isTwoFa(): ?bool
{
return $this->twoFa;
}
public function getCountry(): ?string
{
return $this->country;
}
public function setCountry(?string $country): static
{
$this->country = $country;
return $this;
}
/**
* @return Collection<int, UserEmailEntity>
*/
public function getUserEmails(): Collection
{
return $this->userEmails;
}
public function addUserEmail(UserEmailEntity $userEmail): static
{
if (!$this->userEmails->contains($userEmail)) {
$this->userEmails->add($userEmail);
$userEmail->setUser($this);
}
return $this;
}
public function removeUserEmail(UserEmailEntity $userEmail): static
{
if ($this->userEmails->removeElement($userEmail)) {
// set the owning side to null (unless already changed)
if ($userEmail->getUser() === $this) {
$userEmail->setUser(null);
}
}
return $this;
}
public function isIsNewsletterSubscriber(): ?bool
{
return $this->isNewsletterSubscriber;
}
public function setIsNewsletterSubscriber(bool $isNewsletterSubscriber): static
{
$this->isNewsletterSubscriber = $isNewsletterSubscriber;
return $this;
}
}