src/Entity/Gos/User.php line 41

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Gos;
  3. use App\Entity\Gos\RenewalOffer\UserRenewalOffer;
  4. use App\Entity\Gos\Uniqskills\LessonReminder;
  5. use App\Entity\Gos\Uniqskills\MergeLog;
  6. use App\Entity\Gos\Uniqskills\OrderError;
  7. use App\Entity\Gos\Uniqskills\Test;
  8. use App\Entity\Gos\Uniqskills\UserAnswer;
  9. use App\Entity\Gos\Uniqskills\UserCertificate;
  10. use App\Entity\Gos\Uniqskills\UserLesson;
  11. use App\Entity\Gos\Uniqskills\UserTest;
  12. use App\Entity\Gos\Uniqskills\UserVideoNotes;
  13. use App\Entity\Gos\VirtualCurrency\VirtualCurrencyOrder;
  14. use App\Entity\Gos\VirtualCurrency\VirtualCurrencyTransaction;
  15. use App\Entity\Gos\VirtualCurrency\VirtualCurrencyWallet;
  16. use Doctrine\Common\Collections\ArrayCollection;
  17. use Doctrine\Common\Collections\Collection;
  18. use Doctrine\ORM\EntityNotFoundException;
  19. use ForumMedia\OTPLoginBundle\Traits\OTPPropertiesTrait;
  20. use FOS\UserBundle\Model\GroupInterface;
  21. use FOS\UserBundle\Model\User as BaseUser;
  22. use Doctrine\ORM\Mapping as ORM;
  23. use libphonenumber\NumberParseException;
  24. use libphonenumber\PhoneNumberFormat;
  25. use libphonenumber\PhoneNumberUtil;
  26. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  27. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  28. use Symfony\Component\Validator\Constraints as Assert;
  29. use JMS\Serializer\Annotation as JMS;
  30. use Symfony\Component\HttpFoundation\File\File;
  31. /**
  32.  * @ORM\Entity(repositoryClass="App\Repository\UserRepository")
  33.  * @ORM\Table(name="fos_user")
  34.  * @ORM\HasLifecycleCallbacks
  35.  * @Vich\Uploadable
  36.  * @UniqueEntity(fields="emailCanonical", errorPath="email", message="fos_user.email.already_used")
  37.  * @UniqueEntity(fields="nick", message="fos_user.nick.already_used")
  38.  */
  39. class User extends BaseUser
  40. {
  41.     use OTPPropertiesTrait;
  42.     /**
  43.      * @ORM\Id
  44.      * @ORM\Column(type="integer")
  45.      * @ORM\GeneratedValue(strategy="AUTO")
  46.      * @JMS\Groups({"ApiMessage", "ApiMessageThread"})
  47.      */
  48.     protected $id;
  49.     public function __construct()
  50.     {
  51.         parent::__construct();
  52.         $this->orders                      = new ArrayCollection();
  53.         $this->salesManagoEvent            = new ArrayCollection();
  54.         $this->orderProductVariantUser     = new ArrayCollection();
  55.         $this->passwordFromImport          = new ArrayCollection();
  56.         $this->userTerms                   = new ArrayCollection();
  57.         $this->assignedCoupons             = new ArrayCollection();
  58.         $this->groups                      = new ArrayCollection();
  59.         $this->touchPoint                  = new ArrayCollection();
  60.         $this->touchPointAll               = new ArrayCollection();
  61.         $this->alerts                      = new ArrayCollection();
  62.         $this->notifications               = new ArrayCollection();
  63.         $this->messages                    = new ArrayCollection();
  64.         $this->emailChangeHistories        = new ArrayCollection();
  65.         $this->userLesson                  = new ArrayCollection();
  66.         $this->mergeLog                    = new ArrayCollection();
  67.         $this->lessonReminder              = new ArrayCollection();
  68.         $this->userAnswer                  = new ArrayCollection();
  69.         $this->userTest                    = new ArrayCollection();
  70.         $this->test                        = new ArrayCollection();
  71.         $this->salesManagoClient           = new ArrayCollection();
  72.         $this->accessToPortalSettings      = new ArrayCollection();
  73.         $this->ordersError                 = new ArrayCollection();
  74.         $this->braintreeResponse           = new ArrayCollection();
  75.         $this->userCertificates            = new ArrayCollection();
  76.         $this->additionalInformation       = new ArrayCollection();
  77.         $this->userFiles                   = new ArrayCollection();
  78.         $this->userNotification            = new ArrayCollection();
  79.         $this->foLogs                      = new ArrayCollection();
  80.         $this->userCards                   = new ArrayCollection();
  81.         $this->userVideoNotes              = new ArrayCollection();
  82.         $this->eventNotificationSchedulers = new ArrayCollection();
  83.         $this->presenceOnEvents            = new ArrayCollection();
  84.         $this->userFirstLoginInfos         = new ArrayCollection();
  85.         $this->userDevices                 = new ArrayCollection();
  86.         $this->smsCodes                    = new ArrayCollection();
  87.         $this->emails                      = new ArrayCollection();
  88.         $this->virtualCurrencyWallets      = new ArrayCollection();
  89.         $this->virtualCurrencyTransactions = new ArrayCollection();
  90.         $this->virtualCurrencyOrders       = new ArrayCollection();
  91.         $this->loginHistories              = new ArrayCollection();
  92.         $this->userCertificatePaths        = new ArrayCollection();
  93.         $this->productReleaseNotifies      = new ArrayCollection();
  94.         $this->userRenewalOffers           = new ArrayCollection();
  95.         $this->usingPortals                = new ArrayCollection();
  96.         $this->assignedFlags               = new ArrayCollection();
  97.         $this->orderProductVariantOmittedUpsells = new ArrayCollection();
  98.     }
  99.     /**
  100.      * Needed for import user from Uniqskills
  101.      *
  102.      * @ORM\Column(type="integer", nullable=true)
  103.      */
  104.     protected $tempUniqskillsId;
  105.     /**
  106.      * @ORM\Column(type="string", nullable=true)
  107.      */
  108.     private $salesmanagoContactid;
  109.     /**
  110.      * @ORM\Column(type="string", nullable=true)
  111.      */
  112.     private $sessionId;
  113.     /**
  114.      * @ORM\Column(type="string", length=255, nullable=true)
  115.      */
  116.     private $firstName;
  117.     /**
  118.      * @ORM\Column(type="string", length=255, nullable=true)
  119.      */
  120.     private $lastName;
  121.     /**
  122.      * @ORM\Column(type="string", length=255, nullable=true, unique=true)
  123.      */
  124.     private $nick;
  125.     /**
  126.      * @ORM\Column(type="string", length=30, nullable=true)
  127.      * @Assert\Length(max = 30)
  128.      */
  129.     private $phoneNumber;
  130.     /**
  131.      * @ORM\Column(type="string", length=5, nullable=true)
  132.      */
  133.     private $phoneNumberPrefix;
  134.     /**
  135.      * @ORM\Column(type="datetime", nullable=true)
  136.      */
  137.     private $birthday;
  138.     /**
  139.      * @ORM\Column(type="datetime", nullable=true)
  140.      */
  141.     private $lastCosCheck;
  142.     /**
  143.      * @ORM\Column(type="boolean", nullable=true)
  144.      */
  145.     private $emailChange;
  146.     /**
  147.      * @ORM\Column(type="string", length=255)
  148.      */
  149.     private $token;
  150.     /**
  151.      * @ORM\Column(name="facebook_id", type="string", length=255, nullable=true)
  152.      */
  153.     protected $facebook_id;
  154.     /**
  155.      * @ORM\Column(name="facebook_access_token", type="string", length=255, nullable=true)
  156.      */
  157.     protected $facebook_access_token;
  158.     /**
  159.      * @ORM\Column(name="google_id", type="string", length=255, nullable=true)
  160.      */
  161.     protected $google_id;
  162.     /**
  163.      * @ORM\Column(name="google_access_token", type="string", length=255, nullable=true)
  164.      */
  165.     protected $google_access_token;
  166.     /**
  167.      * @ORM\Column(type="boolean", nullable=true, options={"default":0})
  168.      */
  169.     private $allowedAdvertising;
  170.     /**
  171.      * NOTE: This is not a mapped field of entity metadata, just a simple property.
  172.      *
  173.      * @Assert\File(
  174.      * maxSize="200k",
  175.      *      mimeTypes={"image/png", "image/jpeg", "image/pjpeg"}
  176.      * )
  177.      *
  178.      * @Vich\UploadableField(mapping="user_image", fileNameProperty="imageName")
  179.      *
  180.      * @var File
  181.      */
  182.     private $imageFile;
  183.     /**
  184.      * @ORM\Column(type="string", length=255, nullable=true)
  185.      *
  186.      * @var string
  187.      */
  188.     private $imageName;
  189.     /**
  190.      * @ORM\OneToMany(targetEntity="App\Entity\Gos\Orders", mappedBy="user")
  191.      */
  192.     private $orders;
  193.     /**
  194.      * @ORM\OneToMany(targetEntity="App\Entity\Gos\SalesManagoEvent", mappedBy="user")
  195.      */
  196.     private $salesManagoEvent;
  197.     /**
  198.      * @ORM\OneToOne(targetEntity="App\Entity\Gos\Address", inversedBy="user", cascade={"persist"})
  199.      * @ORM\JoinColumn()
  200.      */
  201.     private $address;
  202.     /**
  203.      * @ORM\OneToOne(targetEntity="App\Entity\Gos\AddressTmp", inversedBy="user")
  204.      * @ORM\JoinColumn()
  205.      */
  206.     private $addressTmp;
  207.     /**
  208.      * @ORM\OneToOne(targetEntity="App\Entity\Gos\Cart", mappedBy="user", cascade={"persist"})
  209.      */
  210.     private $cart;
  211.     /**
  212.      * @ORM\OneToMany(targetEntity="App\Entity\Gos\OrderProductVariantUser", mappedBy="user")
  213.      */
  214.     private $orderProductVariantUser;
  215.     /**
  216.      * @ORM\OneToMany(targetEntity="App\Entity\Gos\PasswordFromImport", mappedBy="user")
  217.      */
  218.     private $passwordFromImport;
  219.     /**
  220.      * @ORM\OneToMany(targetEntity="App\Entity\Gos\UserTerms", mappedBy="user")
  221.      */
  222.     private $userTerms;
  223.     /**
  224.      * @ORM\OneToMany(targetEntity="App\Entity\Gos\Coupon", mappedBy="user")
  225.      */
  226.     private $assignedCoupons;
  227.     /**
  228.      * @ORM\OneToMany(targetEntity="App\Entity\Gos\ArchivedCoupon", mappedBy="user")
  229.      */
  230.     private $archivedAssignedCoupons;
  231.     /**
  232.      * @ORM\OneToMany(targetEntity="App\Entity\Gos\TouchPoint", mappedBy="user")
  233.      */
  234.     private $touchPoint;
  235.     /**
  236.      * @ORM\OneToMany(targetEntity="App\Entity\Gos\TouchPointAll", mappedBy="user")
  237.      */
  238.     private $touchPointAll;
  239.     /**
  240.      * @ORM\OneToMany(targetEntity="App\Entity\Gos\Message", mappedBy="author")
  241.      */
  242.     private $messages;
  243.     /**
  244.      * @ORM\Column(type="datetime")
  245.      */
  246.     private $createdAt;
  247.     /**
  248.      * @ORM\Column(type="datetime", nullable=true)
  249.      */
  250.     private $updatedAt;
  251.     /**
  252.      * @ORM\ManyToOne(targetEntity="App\Entity\Gos\Timezone", inversedBy="user")
  253.      */
  254.     private $timezone;
  255.     /**
  256.      * @ORM\ManyToOne(targetEntity="App\Entity\Gos\Country", inversedBy="user")
  257.      */
  258.     private $country;
  259.     /**
  260.      * @ORM\Column(type="string", length=128, nullable=true)
  261.      */
  262.     private $actionNumber;
  263.     /**
  264.      * @ORM\Column(type="string", length=100, nullable=true)
  265.      */
  266.     private $fromSource;
  267.     /**
  268.      * @ORM\Column(type="string", length=255, nullable=true)
  269.      */
  270.     private $reginfo;
  271.     /**
  272.      * @ORM\ManyToMany(targetEntity="App\Entity\Gos\Group", inversedBy="users")
  273.      * @ORM\JoinTable(name="users_user_group",
  274.      *     joinColumns={@ORM\JoinColumn(name="user_id", referencedColumnName="id")},
  275.      *     inverseJoinColumns={@ORM\JoinColumn(name="group_id", referencedColumnName="id")}
  276.      * )
  277.      */
  278.     protected $groups;
  279.     /**
  280.      * @ORM\OneToMany(targetEntity="App\Entity\Gos\Alert", mappedBy="user")
  281.      */
  282.     private $alerts;
  283.     /**
  284.      * @ORM\OneToMany(targetEntity="App\Entity\Gos\Notification", mappedBy="user")
  285.      */
  286.     private $notifications;
  287.     /**
  288.      * @ORM\OneToMany(targetEntity="App\Entity\Gos\EmailChangeHistory", mappedBy="user")
  289.      */
  290.     private $emailChangeHistories;
  291.     /**
  292.      * @ORM\OneToMany(targetEntity="App\Entity\Gos\Uniqskills\UserLesson", mappedBy="user")
  293.      */
  294.     private $userLesson;
  295.     /**
  296.      * @ORM\OneToMany(targetEntity="App\Entity\Gos\Uniqskills\MergeLog", mappedBy="mergedByUser")
  297.      */
  298.     private $mergeLog;
  299.     /**
  300.      * @ORM\OneToMany(targetEntity="App\Entity\Gos\Uniqskills\LessonReminder", mappedBy="user")
  301.      */
  302.     private $lessonReminder;
  303.     /**
  304.      * @ORM\OneToMany(targetEntity="App\Entity\Gos\Uniqskills\UserAnswer", mappedBy="user")
  305.      */
  306.     private $userAnswer;
  307.     /**
  308.      * @ORM\OneToMany(targetEntity="App\Entity\Gos\Uniqskills\UserTest", mappedBy="user")
  309.      */
  310.     private $userTest;
  311.     /**
  312.      * @ORM\OneToMany(targetEntity="App\Entity\Gos\Uniqskills\Test", mappedBy="user")
  313.      */
  314.     private $test;
  315.     /**
  316.      * @ORM\OneToMany(targetEntity="App\Entity\Gos\SalesManagoClient", mappedBy="user")
  317.      */
  318.     private $salesManagoClient;
  319.     /**
  320.      * @ORM\ManyToMany(targetEntity="PortalSettings", inversedBy="accessUser")
  321.      * @ORM\JoinTable()
  322.      */
  323.     private $accessToPortalSettings;
  324.     /**
  325.      * @ORM\ManyToOne(targetEntity="PortalSettings", inversedBy="registeredUser")
  326.      * @ORM\JoinColumn()
  327.      */
  328.     private $registeredFrom;
  329.     /**
  330.      * @ORM\OneToMany(targetEntity="App\Entity\Gos\Uniqskills\OrderError", mappedBy="user")
  331.      */
  332.     private $ordersError;
  333.     /**
  334.      * @ORM\Column(type="datetime", nullable=true)
  335.      */
  336.     private $activationDate;
  337.     /**
  338.      * @ORM\OneToOne(targetEntity="App\Entity\Gos\Orders", inversedBy="userFirstOrder", cascade={"persist"})
  339.      */
  340.     private $orderDuringRegistration;
  341.     /**
  342.      * @ORM\Column(type="string", length=100, nullable=true)
  343.      */
  344.     private $campaign;
  345.     /**
  346.      * @ORM\Column(type="string", length=100, nullable=true)
  347.      */
  348.     private $campaignChannel;
  349.     /**
  350.      * @ORM\OneToMany(targetEntity="BraintreeResponse", mappedBy="user")
  351.      */
  352.     private $braintreeResponse;
  353.     /**
  354.      * @ORM\OneToMany(targetEntity="App\Entity\Gos\Uniqskills\UserCertificate", mappedBy="user")
  355.      */
  356.     private $userCertificates;
  357.     /**
  358.      * @ORM\ManyToOne(targetEntity="UserPosition", inversedBy="user")
  359.      */
  360.     private $position;
  361.     /**
  362.      * @ORM\OneToMany(targetEntity="UserAdditionalInfo", mappedBy="user", orphanRemoval=true, cascade={"persist"})
  363.      */
  364.     private $additionalInformation;
  365.     /**
  366.      * @ORM\Column(type="text", nullable=true)
  367.      */
  368.     private $marketing;
  369.     /**
  370.      * @ORM\OneToMany(targetEntity="App\Entity\Gos\UserFiles", mappedBy="user")
  371.      */
  372.     private $userFiles;
  373.     /**
  374.      * @ORM\Column(type="integer", nullable=true)
  375.      */
  376.     private $sendReminderActivation;
  377.     /**
  378.      * @ORM\Column(type="boolean", nullable=true, options={"default":0})
  379.      */
  380.     private $employeeAccount 0;
  381.     /** @var @ORM\Column(type="boolean", nullable=true, options={"default":0}) */
  382.     private $isRobinson;
  383.     /**
  384.      * @ORM\Column(type="string", length=6, nullable=true)
  385.      */
  386.     private $resettingCode;
  387.     /**
  388.      * @ORM\Column(type="string", length=6, nullable=true)
  389.      */
  390.     private $activationCode;
  391.     /**
  392.      * @ORM\Column(type="text", nullable=true)
  393.      */
  394.     private $folders;
  395.     /**
  396.      * @ORM\Column(type="text", nullable=true)
  397.      */
  398.     private $savedArticles;
  399.     /**
  400.      * @ORM\Column(type="datetime", nullable=true)
  401.      */
  402.     private $foldersArticlesUpdatedAt;
  403.     /**
  404.      * @ORM\OneToMany(targetEntity="UserNotification", mappedBy="user")
  405.      */
  406.     private $userNotification;
  407.     /**
  408.      * @ORM\OneToMany(targetEntity=FoLog::class, mappedBy="user")
  409.      */
  410.     private $foLogs;
  411.     /**
  412.      * @ORM\OneToMany(targetEntity=UserCard::class, mappedBy="user", orphanRemoval=true)
  413.      */
  414.     private $userCards;
  415.     /**
  416.      * @ORM\OneToMany(targetEntity=UserVideoNotes::class, mappedBy="user")
  417.      */
  418.     private $userVideoNotes;
  419.     /**
  420.      * @ORM\OneToMany(targetEntity=EventNotificationScheduler::class, mappedBy="user")
  421.      */
  422.     private $eventNotificationSchedulers;
  423.     /**
  424.      * @ORM\ManyToMany(targetEntity=Events::class, mappedBy="presentUsers")
  425.      */
  426.     private $presenceOnEvents;
  427.     /**
  428.      * @ORM\Column(type="string", length=4, nullable=true)
  429.      */
  430.     private $oneTimePassword;
  431.     /**
  432.      * @ORM\Column(type="string", length=255, nullable=true)
  433.      */
  434.     private $otpToken;
  435.     /**
  436.      * @ORM\OneToMany(targetEntity=UserFirstLoginInfo::class, mappedBy="user")
  437.      */
  438.     private $userFirstLoginInfos;
  439.     /**
  440.      * @ORM\OneToMany(targetEntity=UserDevices::class, mappedBy="user")
  441.      */
  442.     private $userDevices;
  443.     /**
  444.      * @ORM\Column(type="string", length=255, nullable=true)
  445.      */
  446.     private $deviceAuthCode;
  447.     /**
  448.      * @ORM\Column(type="string", length=255, nullable=true)
  449.      */
  450.     private $deviceAuthToken;
  451.     /**
  452.      * @ORM\OneToMany(targetEntity="App\Entity\Gos\LeadFormCompleted", mappedBy="user")
  453.      */
  454.     private $leadFormCompleted;
  455.     /**
  456.      * @ORM\OneToMany(targetEntity=SmsCode::class, mappedBy="user", orphanRemoval=true)
  457.      */
  458.     private $smsCodes;
  459.     /**
  460.      * @ORM\OneToMany(targetEntity=Email::class, mappedBy="user")
  461.      */
  462.     private $emails;
  463.     /**
  464.      * @ORM\OneToMany(targetEntity=VirtualCurrencyWallet::class, mappedBy="user")
  465.      */
  466.     private $virtualCurrencyWallets;
  467.     /**
  468.      * @ORM\OneToMany(targetEntity=VirtualCurrencyTransaction::class, mappedBy="user")
  469.      */
  470.     private $virtualCurrencyTransactions;
  471.     /**
  472.      * @ORM\OneToMany(targetEntity=VirtualCurrencyOrder::class, mappedBy="user")
  473.      */
  474.     private $virtualCurrencyOrders;
  475.     /**
  476.      * @ORM\OneToMany(targetEntity=LoginHistory::class, mappedBy="user", orphanRemoval=true)
  477.      */
  478.     private $loginHistories;
  479.     /**
  480.      * @ORM\OneToMany(targetEntity=UserCertificatePath::class, mappedBy="user")
  481.      */
  482.     private $userCertificatePaths;
  483.     /**
  484.      * @ORM\OneToMany(targetEntity=ProductReleaseNotify::class, mappedBy="user")
  485.      */
  486.     private $productReleaseNotifies;
  487.     /**
  488.      * @ORM\Column(type="datetime", nullable=true)
  489.      */
  490.     private $lastFailureDiaboloResponseAt;
  491.     /**
  492.      * @ORM\OneToMany(targetEntity=UserRenewalOffer::class, mappedBy="user", orphanRemoval=true)
  493.      */
  494.     private $userRenewalOffers;
  495.     /**
  496.      * @ORM\ManyToMany(targetEntity=PortalSettings::class, inversedBy="users")
  497.      * @ORM\JoinTable(name="user_uses_portal")
  498.      */
  499.     private $usingPortals;
  500.     /**
  501.      * @ORM\OneToMany(targetEntity=AssignedUserFlag::class, mappedBy="user", orphanRemoval=true)
  502.      */
  503.     private $assignedFlags;
  504.     /**
  505.      * @ORM\OneToMany(targetEntity=OrderProductVariantOmittedUpsell::class, mappedBy="user")
  506.      */
  507.     private $orderProductVariantOmittedUpsells;
  508.     /**
  509.      * @ORM\Column(type="integer", nullable=true)
  510.      */
  511.     private $npwz;
  512.     /**
  513.      * @ORM\Column(type="boolean", nullable=true)
  514.      */
  515.     private $isDarkModeActive 0;
  516.     /**
  517.      * TODO: DEV-784 delete field after complete withdrawal of GetResponse
  518.      *
  519.      * @ORM\Column(type="string", length=255, nullable=true)
  520.      */
  521.     private $getResponseContactId;
  522.     /**
  523.      * @ORM\Column(type="string", length=255, nullable=true)
  524.      */
  525.     private $salesmanago2ContactId;
  526.     /** @ORM\PrePersist() */
  527.     public function prePersist()
  528.     {
  529.         $this->token     uniqid(bin2hex(random_bytes(10)));
  530.         $this->createdAt = new \DateTime();
  531.     }
  532.     /** @ORM\PreUpdate() */
  533.     public function preUpdate()
  534.     {
  535.         $this->updatedAt = new \DateTime();
  536.     }
  537.     public function getRoles(): array
  538.     {
  539.         $roles parent::getRoles();
  540.         foreach ($this->groups as $group)
  541.         {
  542.             $roles array_merge($roles$group->getRoles());
  543.         }
  544.         return $roles;
  545.     }
  546.     public function getUserFilesWithoutVideos()
  547.     {
  548.         return array_filter($this->userFiles->toArray(), function($fileUser){ return !($fileUser->getFile()->isVideo());});
  549.     }
  550.     public function getUserVideos()
  551.     {
  552.         return array_filter($this->userFiles->toArray(), function($fileUser){ return ($fileUser->getFile()->isVideo());});
  553.     }
  554.     public function checkUserHasFile(\App\Entity\Gos\File $file): bool
  555.     {
  556.         $existFile array_filter($this->userFiles->toArray(), function($fileUser) use($file) { return ($fileUser->getFile() === $file);});
  557.         return !empty($existFile);
  558.     }
  559.     public function checkUserHasCertificate(\App\Entity\Gos\Uniqskills\Certificate $certificate): bool
  560.     {
  561.         $existCertificate array_filter($this->userCertificates->toArray(), function($userCertificate) use($certificate) { return ($userCertificate->getCertificate() === $certificate);});
  562.         return !empty($existCertificate);
  563.     }
  564.     public function getUserFastCertificates(): array
  565.     {
  566.         return array_filter($this->userCertificates->toArray(), function($userCertificate){
  567.             return ($userCertificate->getCertificate()->isFastCertificate() && $userCertificate->getIsFromCertificatePath() !== true);
  568.         });
  569.     }
  570.     public function getUserPaidCertificates(): array
  571.     {
  572.         return array_filter($this->userCertificates->toArray(), function($userCertificate){
  573.             return ($userCertificate->getCertificate()->isPaidCertificate() && $userCertificate->getIsFromCertificatePath() !== true);
  574.         });
  575.     }
  576.     public function base64EncodeUserId()
  577.     {
  578.         return base64_encode('user-'.$this->id);
  579.     }
  580.     public function setEmail($email)
  581.     {
  582.         $email is_null($email) ? '' $email;
  583.         parent::setEmail($email);
  584.         $this->setUsername($email);
  585.         return $this;
  586.     }
  587.     public function getObjectVars()
  588.     {
  589.         return get_object_vars($this);
  590.     }
  591.     /**
  592.      * If manually uploading a file (i.e. not using Symfony Form) ensure an instance
  593.      * of 'UploadedFile' is injected into this setter to trigger the  update. If this
  594.      * bundle's configuration parameter 'inject_on_load' is set to 'true' this setter
  595.      * must be able to accept an instance of 'File' as the bundle will inject one here
  596.      * during Doctrine hydration.
  597.      *
  598.      * @param File|\Symfony\Component\HttpFoundation\File\UploadedFile $image
  599.      *
  600.      * @return User
  601.      */
  602.     public function setImageFile(File $image null)
  603.     {
  604.         $this->imageFile $image;
  605.         if ($image) {
  606.             // It is required that at least one field changes if you are using doctrine
  607.             // otherwise the event listeners won't be called and the file is lost
  608.             $this->updatedAt = new \DateTimeImmutable();
  609.         }
  610.         return $this;
  611.     }
  612.     /**
  613.      * @return File|null
  614.      */
  615.     public function getImageFile()
  616.     {
  617.         return $this->imageFile;
  618.     }
  619.     /**
  620.      * @param string $imageName
  621.      *
  622.      * @return User
  623.      */
  624.     public function setImageName($imageName)
  625.     {
  626.         $this->imageName $imageName;
  627.         return $this;
  628.     }
  629.     /**
  630.      * @return string|null
  631.      */
  632.     public function getImageName()
  633.     {
  634.         return $this->imageName;
  635.     }
  636.     /**
  637.      * Set sessionId
  638.      *
  639.      * @param string $sessionId
  640.      *
  641.      * @return User
  642.      */
  643.     public function setSessionId($sessionId)
  644.     {
  645.         $this->sessionId $sessionId;
  646.         return $this;
  647.     }
  648.     /**
  649.      * Get sessionId
  650.      *
  651.      * @return string
  652.      */
  653.     public function getSessionId()
  654.     {
  655.         return $this->sessionId;
  656.     }
  657.     /**
  658.      * Set firstName
  659.      *
  660.      * @param string $firstName
  661.      *
  662.      * @return User
  663.      */
  664.     public function setFirstName($firstName)
  665.     {
  666.         $this->firstName $firstName;
  667.         return $this;
  668.     }
  669.     /**
  670.      * Get firstName
  671.      *
  672.      * @return string
  673.      */
  674.     public function getFirstName()
  675.     {
  676.         return $this->firstName;
  677.     }
  678.     /**
  679.      * Set lastName
  680.      *
  681.      * @param string $lastName
  682.      *
  683.      * @return User
  684.      */
  685.     public function setLastName($lastName)
  686.     {
  687.         $this->lastName $lastName;
  688.         return $this;
  689.     }
  690.     /**
  691.      * Get lastName
  692.      *
  693.      * @return string
  694.      */
  695.     public function getLastName()
  696.     {
  697.         return $this->lastName;
  698.     }
  699.     /**
  700.      * Set nick
  701.      *
  702.      * @param string $nick
  703.      *
  704.      * @return User
  705.      */
  706.     public function setNick($nick)
  707.     {
  708.         $this->nick $nick;
  709.         return $this;
  710.     }
  711.     /**
  712.      * Get nick
  713.      *
  714.      * @return string
  715.      */
  716.     public function getNick()
  717.     {
  718.         return $this->nick;
  719.     }
  720.     /**
  721.      * @return string
  722.      */
  723.     public function getNickForCMS()
  724.     {
  725.         return isset($this->nick)
  726.                ? $this->nick
  727.                : (
  728.                    isset($this->firstName)
  729.                    ? $this->firstName
  730.                    "User"
  731.             );
  732.     }
  733.     /**
  734.      * Set phoneNumber
  735.      *
  736.      * @param string $phoneNumber
  737.      *
  738.      * @return User
  739.      */
  740.     public function setPhoneNumber($phoneNumber)
  741.     {
  742.         $this->phoneNumber $phoneNumber;
  743.         return $this;
  744.     }
  745.     /**
  746.      * Get phoneNumber
  747.      *
  748.      * @return string
  749.      */
  750.     public function getPhoneNumber()
  751.     {
  752.         return $this->phoneNumber;
  753.     }
  754.     public function getPhoneNumberWithPLPrefix(): ?string
  755.     {
  756.         if ($this->getPhoneNumber() === null)
  757.         {
  758.             return null;
  759.         }
  760.         $phoneUtil PhoneNumberUtil::getInstance();
  761.         try {
  762.             $parsedNumber $phoneUtil->parse($this->getPhoneNumber(), 'PL');
  763.             if ($parsedNumber && $phoneUtil->isValidNumber($parsedNumber)) {
  764.                 return $phoneUtil->format($parsedNumberPhoneNumberFormat::E164);
  765.             }
  766.         } catch (NumberParseException $e) {}
  767.         return null;
  768.     }
  769.     /**
  770.      * Set phoneNumberPrefix
  771.      *
  772.      * @param string $phoneNumberPrefix
  773.      * @return User
  774.      */
  775.     public function setPhoneNumberPrefix($phoneNumberPrefix)
  776.     {
  777.         $this->phoneNumberPrefix $phoneNumberPrefix;
  778.         return $this;
  779.     }
  780.     /**
  781.      * @return mixed
  782.      */
  783.     public function getBirthday()
  784.     {
  785.         return $this->birthday;
  786.     }
  787.     /**
  788.      * @param mixed $birthday
  789.      */
  790.     public function setBirthday($birthday)
  791.     {
  792.         $this->birthday $birthday;
  793.         return $this;
  794.     }
  795.     /**
  796.      * Get phoneNumberPrefix
  797.      *
  798.      * @return string
  799.      */
  800.     public function getPhoneNumberPrefix()
  801.     {
  802.         return $this->phoneNumberPrefix;
  803.     }
  804.     /**
  805.      * Set lastCosCheck
  806.      *
  807.      * @param \DateTime $lastCosCheck
  808.      *
  809.      * @return User
  810.      */
  811.     public function setLastCosCheck($lastCosCheck)
  812.     {
  813.         $this->lastCosCheck $lastCosCheck;
  814.         return $this;
  815.     }
  816.     /**
  817.      * Get lastCosCheck
  818.      *
  819.      * @return \DateTime
  820.      */
  821.     public function getLastCosCheck()
  822.     {
  823.         return $this->lastCosCheck;
  824.     }
  825.     /**
  826.      * Set token
  827.      *
  828.      * @param string $token
  829.      *
  830.      * @return User
  831.      */
  832.     public function setToken($token)
  833.     {
  834.         $this->token $token;
  835.         return $this;
  836.     }
  837.     /**
  838.      * Get token
  839.      *
  840.      * @return string
  841.      */
  842.     public function getToken()
  843.     {
  844.         return $this->token;
  845.     }
  846.     /**
  847.      * Set createdAt
  848.      *
  849.      * @param \DateTime $createdAt
  850.      *
  851.      * @return User
  852.      */
  853.     public function setCreatedAt($createdAt)
  854.     {
  855.         $this->createdAt $createdAt;
  856.         return $this;
  857.     }
  858.     /**
  859.      * Get createdAt
  860.      *
  861.      * @return \DateTime
  862.      */
  863.     public function getCreatedAt()
  864.     {
  865.         return $this->createdAt;
  866.     }
  867.     /**
  868.      * Set updatedAt
  869.      *
  870.      * @param \DateTime $updatedAt
  871.      *
  872.      * @return User
  873.      */
  874.     public function setUpdatedAt($updatedAt)
  875.     {
  876.         $this->updatedAt $updatedAt;
  877.         return $this;
  878.     }
  879.     /**
  880.      * Get updatedAt
  881.      *
  882.      * @return \DateTime
  883.      */
  884.     public function getUpdatedAt()
  885.     {
  886.         return $this->updatedAt;
  887.     }
  888.     /**
  889.      * Add order
  890.      *
  891.      * @param \App\Entity\Gos\Orders $order
  892.      *
  893.      * @return User
  894.      */
  895.     public function addOrder(\App\Entity\Gos\Orders $order)
  896.     {
  897.         $this->orders[] = $order;
  898.         return $this;
  899.     }
  900.     /**
  901.      * Remove order
  902.      *
  903.      * @param \App\Entity\Gos\Orders $order
  904.      */
  905.     public function removeOrder(\App\Entity\Gos\Orders $order)
  906.     {
  907.         $this->orders->removeElement($order);
  908.     }
  909.     /**
  910.      * Get orders
  911.      *
  912.      * @return \Doctrine\Common\Collections\Collection
  913.      */
  914.     public function getOrders()
  915.     {
  916.         return $this->orders;
  917.     }
  918.     /**
  919.      * Set address
  920.      *
  921.      * @param \App\Entity\Gos\Address $address
  922.      *
  923.      * @return User
  924.      */
  925.     public function setAddress(\App\Entity\Gos\Address $address null)
  926.     {
  927.         $this->address $address;
  928.         return $this;
  929.     }
  930.     /**
  931.      * Get address
  932.      *
  933.      * @return \App\Entity\Gos\Address
  934.      */
  935.     public function getAddress()
  936.     {
  937.         return $this->address;
  938.     }
  939.     
  940.     /**
  941.      * Set cart
  942.      *
  943.      * @param \App\Entity\Gos\Cart $cart
  944.      *
  945.      * @return User
  946.      */
  947.     public function setCart(\App\Entity\Gos\Cart $cart null)
  948.     {
  949.         $this->cart $cart;
  950.         return $this;
  951.     }
  952.     /**
  953.      * Get cart
  954.      *
  955.      * @return \App\Entity\Gos\Cart
  956.      */
  957.     public function getCart()
  958.     {
  959.         return $this->cart;
  960.     }
  961.     /**
  962.      * Set emailChange
  963.      *
  964.      * @param boolean $emailChange
  965.      *
  966.      * @return User
  967.      */
  968.     public function setEmailChange($emailChange)
  969.     {
  970.         $this->emailChange $emailChange;
  971.         return $this;
  972.     }
  973.     /**
  974.      * Get emailChange
  975.      *
  976.      * @return boolean
  977.      */
  978.     public function getEmailChange()
  979.     {
  980.         return $this->emailChange;
  981.     }
  982.     /**
  983.      * Set facebookId
  984.      *
  985.      * @param string $facebookId
  986.      *
  987.      * @return User
  988.      */
  989.     public function setFacebookId($facebookId)
  990.     {
  991.         $this->facebook_id $facebookId;
  992.         return $this;
  993.     }
  994.     /**
  995.      * Get facebookId
  996.      *
  997.      * @return string
  998.      */
  999.     public function getFacebookId()
  1000.     {
  1001.         return $this->facebook_id;
  1002.     }
  1003.     /**
  1004.      * Set googleId
  1005.      *
  1006.      * @param string $googleId
  1007.      *
  1008.      * @return User
  1009.      */
  1010.     public function setGoogleId($googleId)
  1011.     {
  1012.         $this->google_id $googleId;
  1013.         return $this;
  1014.     }
  1015.     /**
  1016.      * Get googleId
  1017.      *
  1018.      * @return string
  1019.      */
  1020.     public function getGoogleId()
  1021.     {
  1022.         return $this->google_id;
  1023.     }
  1024.     /**
  1025.      * Set facebookAccessToken
  1026.      *
  1027.      * @param string $facebookAccessToken
  1028.      *
  1029.      * @return User
  1030.      */
  1031.     public function setFacebookAccessToken($facebookAccessToken)
  1032.     {
  1033.         $this->facebook_access_token $facebookAccessToken;
  1034.         return $this;
  1035.     }
  1036.     /**
  1037.      * Get facebookAccessToken
  1038.      *
  1039.      * @return string
  1040.      */
  1041.     public function getFacebookAccessToken()
  1042.     {
  1043.         return $this->facebook_access_token;
  1044.     }
  1045.     /**
  1046.      * Set googleAccessToken
  1047.      *
  1048.      * @param string $googleAccessToken
  1049.      *
  1050.      * @return User
  1051.      */
  1052.     public function setGoogleAccessToken($googleAccessToken)
  1053.     {
  1054.         $this->google_access_token $googleAccessToken;
  1055.         return $this;
  1056.     }
  1057.     /**
  1058.      * Get googleAccessToken
  1059.      *
  1060.      * @return string
  1061.      */
  1062.     public function getGoogleAccessToken()
  1063.     {
  1064.         return $this->google_access_token;
  1065.     }
  1066.     /**
  1067.      * Add orderProductVariantUser
  1068.      *
  1069.      * @param \App\Entity\Gos\OrderProductVariantUser $orderProductVariantUser
  1070.      *
  1071.      * @return User
  1072.      */
  1073.     public function addOrderProductVariantUser(\App\Entity\Gos\OrderProductVariantUser $orderProductVariantUser)
  1074.     {
  1075.         $this->orderProductVariantUser[] = $orderProductVariantUser;
  1076.         return $this;
  1077.     }
  1078.     /**
  1079.      * Remove orderProductVariantUser
  1080.      *
  1081.      * @param \App\Entity\Gos\OrderProductVariantUser $orderProductVariantUser
  1082.      */
  1083.     public function removeOrderProductVariantUser(\App\Entity\Gos\OrderProductVariantUser $orderProductVariantUser)
  1084.     {
  1085.         $this->orderProductVariantUser->removeElement($orderProductVariantUser);
  1086.     }
  1087.     /**
  1088.      * Get orderProductVariantUser
  1089.      *
  1090.      * @return \Doctrine\Common\Collections\Collection
  1091.      */
  1092.     public function getOrderProductVariantUser()
  1093.     {
  1094.         return $this->orderProductVariantUser;
  1095.     }
  1096.     /**
  1097.      * Add passwordFromImport
  1098.      *
  1099.      * @param \App\Entity\Gos\PasswordFromImport $passwordFromImport
  1100.      *
  1101.      * @return User
  1102.      */
  1103.     public function addPasswordFromImport(\App\Entity\Gos\PasswordFromImport $passwordFromImport)
  1104.     {
  1105.         $this->passwordFromImport[] = $passwordFromImport;
  1106.         return $this;
  1107.     }
  1108.     /**
  1109.      * Remove passwordFromImport
  1110.      *
  1111.      * @param \App\Entity\Gos\PasswordFromImport $passwordFromImport
  1112.      */
  1113.     public function removePasswordFromImport(\App\Entity\Gos\PasswordFromImport $passwordFromImport)
  1114.     {
  1115.         $this->passwordFromImport->removeElement($passwordFromImport);
  1116.     }
  1117.     /**
  1118.      * Get passwordFromImport
  1119.      *
  1120.      * @return \Doctrine\Common\Collections\Collection
  1121.      */
  1122.     public function getPasswordFromImport()
  1123.     {
  1124.         return $this->passwordFromImport;
  1125.     }
  1126.     /**
  1127.      * Set timezone
  1128.      *
  1129.      * @param \App\Entity\Gos\Timezone $timezone
  1130.      *
  1131.      * @return User
  1132.      */
  1133.     public function setTimezone(\App\Entity\Gos\Timezone $timezone)
  1134.     {
  1135.         $this->timezone $timezone;
  1136.         return $this;
  1137.     }
  1138.     /**
  1139.      * Get timezone
  1140.      *
  1141.      * @return \App\Entity\Gos\Timezone
  1142.      */
  1143.     public function getTimezone()
  1144.     {
  1145.         return $this->timezone;
  1146.     }
  1147.     /**
  1148.      * Set country
  1149.      *
  1150.      * @param \App\Entity\Gos\Country $country
  1151.      *
  1152.      * @return User
  1153.      */
  1154.     public function setCountry(\App\Entity\Gos\Country $country)
  1155.     {
  1156.         $this->country $country;
  1157.         return $this;
  1158.     }
  1159.     /**
  1160.      * Get country
  1161.      *
  1162.      * @return \App\Entity\Gos\Country
  1163.      */
  1164.     public function getCountry()
  1165.     {
  1166.         return $this->country;
  1167.     }
  1168.     /**
  1169.      * Set actionNumber
  1170.      *
  1171.      * @param string $actionNumber
  1172.      *
  1173.      * @return User
  1174.      */
  1175.     public function setActionNumber($actionNumber)
  1176.     {
  1177.         $this->actionNumber $actionNumber;
  1178.         return $this;
  1179.     }
  1180.     /**
  1181.      * Get actionNumber
  1182.      *
  1183.      * @return string
  1184.      */
  1185.     public function getActionNumber()
  1186.     {
  1187.         return $this->actionNumber;
  1188.     }
  1189.     /**
  1190.      * Add userTerm
  1191.      *
  1192.      * @param \App\Entity\Gos\UserTerms $userTerm
  1193.      *
  1194.      * @return User
  1195.      */
  1196.     public function addUserTerm(\App\Entity\Gos\UserTerms $userTerm)
  1197.     {
  1198.         $this->userTerms[] = $userTerm;
  1199.         return $this;
  1200.     }
  1201.     /**
  1202.      * Remove userTerm
  1203.      *
  1204.      * @param \App\Entity\Gos\UserTerms $userTerm
  1205.      */
  1206.     public function removeUserTerm(\App\Entity\Gos\UserTerms $userTerm)
  1207.     {
  1208.         $this->userTerms->removeElement($userTerm);
  1209.     }
  1210.     /**
  1211.      * Get userTerms
  1212.      *
  1213.      * @return \Doctrine\Common\Collections\Collection
  1214.      */
  1215.     public function getUserTerms()
  1216.     {
  1217.         return $this->userTerms;
  1218.     }
  1219.     /**
  1220.      * Set allowedAdvertising
  1221.      *
  1222.      * @param boolean $allowedAdvertising
  1223.      *
  1224.      * @return User
  1225.      */
  1226.     public function setAllowedAdvertising($allowedAdvertising)
  1227.     {
  1228.         $this->allowedAdvertising $allowedAdvertising;
  1229.         return $this;
  1230.     }
  1231.     /**
  1232.      * Get allowedAdvertising
  1233.      *
  1234.      * @return boolean
  1235.      */
  1236.     public function getAllowedAdvertising()
  1237.     {
  1238.         return $this->allowedAdvertising;
  1239.     }
  1240.     /**
  1241.      * Add salesManagoEvent
  1242.      *
  1243.      * @param \App\Entity\Gos\SalesManagoEvent $salesManagoEvent
  1244.      *
  1245.      * @return User
  1246.      */
  1247.     public function addSalesManagoEvent(\App\Entity\Gos\SalesManagoEvent $salesManagoEvent)
  1248.     {
  1249.         $this->salesManagoEvent[] = $salesManagoEvent;
  1250.         return $this;
  1251.     }
  1252.     /**
  1253.      * Remove salesManagoEvent
  1254.      *
  1255.      * @param \App\Entity\Gos\SalesManagoEvent $salesManagoEvent
  1256.      */
  1257.     public function removeSalesManagoEvent(\App\Entity\Gos\SalesManagoEvent $salesManagoEvent)
  1258.     {
  1259.         $this->salesManagoEvent->removeElement($salesManagoEvent);
  1260.     }
  1261.     /**
  1262.      * Get salesManagoEvent
  1263.      *
  1264.      * @return \Doctrine\Common\Collections\Collection
  1265.      */
  1266.     public function getSalesManagoEvent()
  1267.     {
  1268.         return $this->salesManagoEvent;
  1269.     }
  1270.     public function getId(): ?int
  1271.     {
  1272.         return $this->id;
  1273.     }
  1274.     /**
  1275.      * @return Collection|Coupon[]
  1276.      */
  1277.     public function getAssignedCoupons(): Collection
  1278.     {
  1279.         return $this->assignedCoupons;
  1280.     }
  1281.     public function addAssignedCoupon(Coupon $assignedCoupon): self
  1282.     {
  1283.         if (!$this->assignedCoupons->contains($assignedCoupon)) {
  1284.             $this->assignedCoupons[] = $assignedCoupon;
  1285.             $assignedCoupon->setUser($this);
  1286.         }
  1287.         return $this;
  1288.     }
  1289.     public function removeAssignedCoupon(Coupon $assignedCoupon): self
  1290.     {
  1291.         if ($this->assignedCoupons->contains($assignedCoupon)) {
  1292.             $this->assignedCoupons->removeElement($assignedCoupon);
  1293.             // set the owning side to null (unless already changed)
  1294.             if ($assignedCoupon->getUser() === $this) {
  1295.                 $assignedCoupon->setUser(null);
  1296.             }
  1297.         }
  1298.         return $this;
  1299.     }
  1300.     /**
  1301.      * @return Collection|TouchPoint[]
  1302.      */
  1303.     public function getTouchPoint(): Collection
  1304.     {
  1305.         return $this->touchPoint;
  1306.     }
  1307.     public function addTouchPoint(TouchPoint $touchPoint): self
  1308.     {
  1309.         if (!$this->touchPoint->contains($touchPoint)) {
  1310.             $this->touchPoint[] = $touchPoint;
  1311.             $touchPoint->setUser($this);
  1312.         }
  1313.         return $this;
  1314.     }
  1315.     public function removeTouchPoint(TouchPoint $touchPoint): self
  1316.     {
  1317.         if ($this->touchPoint->contains($touchPoint)) {
  1318.             $this->touchPoint->removeElement($touchPoint);
  1319.             // set the owning side to null (unless already changed)
  1320.             if ($touchPoint->getUser() === $this) {
  1321.                 $touchPoint->setUser(null);
  1322.             }
  1323.         }
  1324.         return $this;
  1325.     }
  1326.     /**
  1327.      * @return Collection|Alert[]
  1328.      */
  1329.     public function getAlerts(): Collection
  1330.     {
  1331.         return $this->alerts;
  1332.     }
  1333.     public function addAlert(Alert $alert): self
  1334.     {
  1335.         if (!$this->alerts->contains($alert)) {
  1336.             $this->alerts[] = $alert;
  1337.             $alert->setUser($this);
  1338.         }
  1339.         return $this;
  1340.     }
  1341.     public function removeAlert(Alert $alert): self
  1342.     {
  1343.         if ($this->alerts->contains($alert)) {
  1344.             $this->alerts->removeElement($alert);
  1345.             // set the owning side to null (unless already changed)
  1346.             if ($alert->getUser() === $this) {
  1347.                 $alert->setUser(null);
  1348.             }
  1349.         }
  1350.         return $this;
  1351.     }
  1352.     /**
  1353.      * @return Collection|Notification[]
  1354.      */
  1355.     public function getNotifications(): Collection
  1356.     {
  1357.         return $this->notifications;
  1358.     }
  1359.     /**
  1360.      * @return Collection|Alert[]
  1361.      */
  1362.     public function getUnreadNotifications(): Collection
  1363.     {
  1364.         return $this->notifications->filter(
  1365.             function ($notification) {
  1366.                 return $notification->getIsUnread();
  1367.             }
  1368.         );
  1369.     }
  1370.     public function addNotification(Notification $notification): self
  1371.     {
  1372.         if (!$this->notifications->contains($notification)) {
  1373.             $this->notifications[] = $notification;
  1374.             $notification->setUser($this);
  1375.         }
  1376.         return $this;
  1377.     }
  1378.     public function removeNotification(Notification $notification): self
  1379.     {
  1380.         if ($this->notifications->contains($notification)) {
  1381.             $this->notifications->removeElement($notification);
  1382.             // set the owning side to null (unless already changed)
  1383.             if ($notification->getUser() === $this) {
  1384.                 $notification->setUser(null);
  1385.             }
  1386.         }
  1387.         return $this;
  1388.     }
  1389.     /**
  1390.      * @return Collection|Message[]
  1391.      */
  1392.     public function getMessages(): Collection
  1393.     {
  1394.         return $this->messages;
  1395.     }
  1396.     public function addMessage(Message $message): self
  1397.     {
  1398.         if (!$this->messages->contains($message)) {
  1399.             $this->messages[] = $message;
  1400.             $message->setAuthor($this);
  1401.         }
  1402.         return $this;
  1403.     }
  1404.     public function removeMessage(Message $message): self
  1405.     {
  1406.         if ($this->messages->contains($message)) {
  1407.             $this->messages->removeElement($message);
  1408.             // set the owning side to null (unless already changed)
  1409.             if ($message->getAuthor() === $this) {
  1410.                 $message->setAuthor(null);
  1411.             }
  1412.         }
  1413.         return $this;
  1414.     }
  1415.     /**
  1416.      * @return Collection|EmailChangeHistory[]
  1417.      */
  1418.     public function getEmailChangeHistories(): Collection
  1419.     {
  1420.         return $this->emailChangeHistories;
  1421.     }
  1422.     public function addEmailChangeHistory(EmailChangeHistory $emailChangeHistory): self
  1423.     {
  1424.         if (!$this->emailChangeHistories->contains($emailChangeHistory)) {
  1425.             $this->emailChangeHistories[] = $emailChangeHistory;
  1426.             $emailChangeHistory->setUser($this);
  1427.         }
  1428.         return $this;
  1429.     }
  1430.     public function removeEmailChangeHistory(EmailChangeHistory $emailChangeHistory): self
  1431.     {
  1432.         if ($this->emailChangeHistories->contains($emailChangeHistory)) {
  1433.             $this->emailChangeHistories->removeElement($emailChangeHistory);
  1434.             // set the owning side to null (unless already changed)
  1435.             if ($emailChangeHistory->getUser() === $this) {
  1436.                 $emailChangeHistory->setUser(null);
  1437.             }
  1438.         }
  1439.         return $this;
  1440.     }
  1441.     public function getSalesmanagoContactid(): ?string
  1442.     {
  1443.         return $this->salesmanagoContactid;
  1444.     }
  1445.     public function setSalesmanagoContactid(?string $salesmanagoContactid): self
  1446.     {
  1447.         $this->salesmanagoContactid $salesmanagoContactid;
  1448.         return $this;
  1449.     }
  1450.     public function getAddressTmp(): ?AddressTmp
  1451.     {
  1452.         return $this->addressTmp;
  1453.     }
  1454.     public function setAddressTmp(?AddressTmp $addressTmp): self
  1455.     {
  1456.         $this->addressTmp $addressTmp;
  1457.         return $this;
  1458.     }
  1459.     /**
  1460.      * @return Collection|Group[]
  1461.      */
  1462.     public function getGroups(): Collection
  1463.     {
  1464.         return $this->groups;
  1465.     }
  1466.     public function addGroup($group): self
  1467.     {
  1468.         if (!$this->groups->contains($group)) {
  1469.             $this->groups[] = $group;
  1470.         }
  1471.         return $this;
  1472.     }
  1473.     public function removeGroup($group): self
  1474.     {
  1475.         if ($this->groups->contains($group)) {
  1476.             $this->groups->removeElement($group);
  1477.         }
  1478.         return $this;
  1479.     }
  1480.     public function getFromSource(): ?string
  1481.     {
  1482.         return $this->fromSource;
  1483.     }
  1484.     public function setFromSource(?string $fromSource): self
  1485.     {
  1486.         $this->fromSource $fromSource;
  1487.         return $this;
  1488.     }
  1489.     /**
  1490.      * @return Collection|UserLesson[]
  1491.      */
  1492.     public function getUserLesson(): Collection
  1493.     {
  1494.         return $this->userLesson;
  1495.     }
  1496.     public function addUserLesson(UserLesson $userLesson): self
  1497.     {
  1498.         if (!$this->userLesson->contains($userLesson)) {
  1499.             $this->userLesson[] = $userLesson;
  1500.             $userLesson->setUser($this);
  1501.         }
  1502.         return $this;
  1503.     }
  1504.     public function removeUserLesson(UserLesson $userLesson): self
  1505.     {
  1506.         if ($this->userLesson->contains($userLesson)) {
  1507.             $this->userLesson->removeElement($userLesson);
  1508.             // set the owning side to null (unless already changed)
  1509.             if ($userLesson->getUser() === $this) {
  1510.                 $userLesson->setUser(null);
  1511.             }
  1512.         }
  1513.         return $this;
  1514.     }
  1515.     /**
  1516.      * @return Collection|MergeLog[]
  1517.      */
  1518.     public function getMergeLog(): Collection
  1519.     {
  1520.         return $this->mergeLog;
  1521.     }
  1522.     public function addMergeLog(MergeLog $mergeLog): self
  1523.     {
  1524.         if (!$this->mergeLog->contains($mergeLog)) {
  1525.             $this->mergeLog[] = $mergeLog;
  1526.             $mergeLog->setMergedByUser($this);
  1527.         }
  1528.         return $this;
  1529.     }
  1530.     public function removeMergeLog(MergeLog $mergeLog): self
  1531.     {
  1532.         if ($this->mergeLog->contains($mergeLog)) {
  1533.             $this->mergeLog->removeElement($mergeLog);
  1534.             // set the owning side to null (unless already changed)
  1535.             if ($mergeLog->getMergedByUser() === $this) {
  1536.                 $mergeLog->setMergedByUser(null);
  1537.             }
  1538.         }
  1539.         return $this;
  1540.     }
  1541.     /**
  1542.      * @return Collection|LessonReminder[]
  1543.      */
  1544.     public function getLessonReminder(): Collection
  1545.     {
  1546.         return $this->lessonReminder;
  1547.     }
  1548.     public function addLessonReminder(LessonReminder $lessonReminder): self
  1549.     {
  1550.         if (!$this->lessonReminder->contains($lessonReminder)) {
  1551.             $this->lessonReminder[] = $lessonReminder;
  1552.             $lessonReminder->setUser($this);
  1553.         }
  1554.         return $this;
  1555.     }
  1556.     public function removeLessonReminder(LessonReminder $lessonReminder): self
  1557.     {
  1558.         if ($this->lessonReminder->contains($lessonReminder)) {
  1559.             $this->lessonReminder->removeElement($lessonReminder);
  1560.             // set the owning side to null (unless already changed)
  1561.             if ($lessonReminder->getUser() === $this) {
  1562.                 $lessonReminder->setUser(null);
  1563.             }
  1564.         }
  1565.         return $this;
  1566.     }
  1567.     /**
  1568.      * @return Collection|UserAnswer[]
  1569.      */
  1570.     public function getUserAnswer(): Collection
  1571.     {
  1572.         return $this->userAnswer;
  1573.     }
  1574.     public function addUserAnswer(UserAnswer $userAnswer): self
  1575.     {
  1576.         if (!$this->userAnswer->contains($userAnswer)) {
  1577.             $this->userAnswer[] = $userAnswer;
  1578.             $userAnswer->setUser($this);
  1579.         }
  1580.         return $this;
  1581.     }
  1582.     public function removeUserAnswer(UserAnswer $userAnswer): self
  1583.     {
  1584.         if ($this->userAnswer->contains($userAnswer)) {
  1585.             $this->userAnswer->removeElement($userAnswer);
  1586.             // set the owning side to null (unless already changed)
  1587.             if ($userAnswer->getUser() === $this) {
  1588.                 $userAnswer->setUser(null);
  1589.             }
  1590.         }
  1591.         return $this;
  1592.     }
  1593.     /**
  1594.      * @return Collection|UserTest[]
  1595.      */
  1596.     public function getUserTest(): Collection
  1597.     {
  1598.         return $this->userTest;
  1599.     }
  1600.     public function addUserTest(UserTest $userTest): self
  1601.     {
  1602.         if (!$this->userTest->contains($userTest)) {
  1603.             $this->userTest[] = $userTest;
  1604.             $userTest->setUser($this);
  1605.         }
  1606.         return $this;
  1607.     }
  1608.     public function removeUserTest(UserTest $userTest): self
  1609.     {
  1610.         if ($this->userTest->contains($userTest)) {
  1611.             $this->userTest->removeElement($userTest);
  1612.             // set the owning side to null (unless already changed)
  1613.             if ($userTest->getUser() === $this) {
  1614.                 $userTest->setUser(null);
  1615.             }
  1616.         }
  1617.         return $this;
  1618.     }
  1619.     /**
  1620.      * @return Collection|Test[]
  1621.      */
  1622.     public function getTest(): Collection
  1623.     {
  1624.         return $this->test;
  1625.     }
  1626.     public function addTest(Test $test): self
  1627.     {
  1628.         if (!$this->test->contains($test)) {
  1629.             $this->test[] = $test;
  1630.             $test->setUser($this);
  1631.         }
  1632.         return $this;
  1633.     }
  1634.     public function removeTest(Test $test): self
  1635.     {
  1636.         if ($this->test->contains($test)) {
  1637.             $this->test->removeElement($test);
  1638.             // set the owning side to null (unless already changed)
  1639.             if ($test->getUser() === $this) {
  1640.                 $test->setUser(null);
  1641.             }
  1642.         }
  1643.         return $this;
  1644.     }
  1645.     public function getReginfo(): ?string
  1646.     {
  1647.         return $this->reginfo;
  1648.     }
  1649.     public function setReginfo(?string $reginfo): self
  1650.     {
  1651.         $this->reginfo $reginfo;
  1652.         return $this;
  1653.     }
  1654.     /**
  1655.      * @return Collection|TouchPointAll[]
  1656.      */
  1657.     public function getTouchPointAll(): Collection
  1658.     {
  1659.         return $this->touchPointAll;
  1660.     }
  1661.     public function addTouchPointAll(TouchPointAll $touchPointAll): self
  1662.     {
  1663.         if (!$this->touchPointAll->contains($touchPointAll)) {
  1664.             $this->touchPointAll[] = $touchPointAll;
  1665.             $touchPointAll->setUser($this);
  1666.         }
  1667.         return $this;
  1668.     }
  1669.     public function removeTouchPointAll(TouchPointAll $touchPointAll): self
  1670.     {
  1671.         if ($this->touchPointAll->contains($touchPointAll)) {
  1672.             $this->touchPointAll->removeElement($touchPointAll);
  1673.             // set the owning side to null (unless already changed)
  1674.             if ($touchPointAll->getUser() === $this) {
  1675.                 $touchPointAll->setUser(null);
  1676.             }
  1677.         }
  1678.         return $this;
  1679.     }
  1680.     public function getTempUniqskillsId(): ?int
  1681.     {
  1682.         return $this->tempUniqskillsId;
  1683.     }
  1684.     public function setTempUniqskillsId(?int $tempUniqskillsId): self
  1685.     {
  1686.         $this->tempUniqskillsId $tempUniqskillsId;
  1687.         return $this;
  1688.     }
  1689.     /**
  1690.      * @return Collection|SalesManagoClient[]
  1691.      */
  1692.     public function getSalesManagoClient(): Collection
  1693.     {
  1694.         return $this->salesManagoClient;
  1695.     }
  1696.     public function addSalesManagoClient(SalesManagoClient $salesManagoClient): self
  1697.     {
  1698.         if (!$this->salesManagoClient->contains($salesManagoClient)) {
  1699.             $this->salesManagoClient[] = $salesManagoClient;
  1700.             $salesManagoClient->setUser($this);
  1701.         }
  1702.         return $this;
  1703.     }
  1704.     public function removeSalesManagoClient(SalesManagoClient $salesManagoClient): self
  1705.     {
  1706.         if ($this->salesManagoClient->contains($salesManagoClient)) {
  1707.             $this->salesManagoClient->removeElement($salesManagoClient);
  1708.             // set the owning side to null (unless already changed)
  1709.             if ($salesManagoClient->getUser() === $this) {
  1710.                 $salesManagoClient->setUser(null);
  1711.             }
  1712.         }
  1713.         return $this;
  1714.     }
  1715.     /**
  1716.      * @return Collection|PortalSettings[]
  1717.      */
  1718.     public function getAccessToPortalSettings(): Collection
  1719.     {
  1720.         return $this->accessToPortalSettings;
  1721.     }
  1722.     public function addAccessToPortalSetting(PortalSettings $accessToPortalSetting): self
  1723.     {
  1724.         if (!$this->accessToPortalSettings->contains($accessToPortalSetting)) {
  1725.             $this->accessToPortalSettings[] = $accessToPortalSetting;
  1726.         }
  1727.         return $this;
  1728.     }
  1729.     public function removeAccessToPortalSetting(PortalSettings $accessToPortalSetting): self
  1730.     {
  1731.         if ($this->accessToPortalSettings->contains($accessToPortalSetting)) {
  1732.             $this->accessToPortalSettings->removeElement($accessToPortalSetting);
  1733.         }
  1734.         return $this;
  1735.     }
  1736.     public function getAccessToPortalSettingsIDs()
  1737.     {
  1738.         return $this->accessToPortalSettings->map(function($obj) {
  1739.             return $obj->getId();
  1740.         })->getValues();
  1741.     }
  1742.     public function getRegisteredFrom(): ?PortalSettings
  1743.     {
  1744.         return $this->registeredFrom;
  1745.     }
  1746.     public function setRegisteredFrom(?PortalSettings $registeredFrom): self
  1747.     {
  1748.         $this->registeredFrom $registeredFrom;
  1749.         return $this;
  1750.     }
  1751.     /**
  1752.      * @return Collection|OrderError[]
  1753.      */
  1754.     public function getOrdersError(): Collection
  1755.     {
  1756.         return $this->ordersError;
  1757.     }
  1758.     public function addOrdersError(OrderError $ordersError): self
  1759.     {
  1760.         if (!$this->ordersError->contains($ordersError)) {
  1761.             $this->ordersError[] = $ordersError;
  1762.             $ordersError->setUser($this);
  1763.         }
  1764.         return $this;
  1765.     }
  1766.     public function removeOrdersError(OrderError $ordersError): self
  1767.     {
  1768.         if ($this->ordersError->contains($ordersError)) {
  1769.             $this->ordersError->removeElement($ordersError);
  1770.             // set the owning side to null (unless already changed)
  1771.             if ($ordersError->getUser() === $this) {
  1772.                 $ordersError->setUser(null);
  1773.             }
  1774.         }
  1775.         return $this;
  1776.     }
  1777.     /**
  1778.      * Set activationDate
  1779.      *
  1780.      * @param \DateTime $activationDate
  1781.      *
  1782.      * @return User
  1783.      */
  1784.     public function setActivationDate($activationDate)
  1785.     {
  1786.         $this->activationDate $activationDate;
  1787.         return $this;
  1788.     }
  1789.     /**
  1790.      * Get activationDate
  1791.      *
  1792.      * @return \DateTime
  1793.      */
  1794.     public function getActivationDate()
  1795.     {
  1796.         return $this->activationDate;
  1797.     }
  1798.     public function setOrderDuringRegistration(Orders $order null)
  1799.     {
  1800.         $this->orderDuringRegistration $order;
  1801.         return $this;
  1802.     }
  1803.     /**
  1804.      * Get orderDuringRegistration
  1805.      *
  1806.      * @return \App\Entity\Gos\Orders
  1807.      */
  1808.     public function getOrderDuringRegistration()
  1809.     {
  1810.         return $this->orderDuringRegistration;
  1811.     }
  1812.     /**
  1813.      * Set campaign
  1814.      *
  1815.      * @param string $campaign
  1816.      * @return User
  1817.      */
  1818.     public function setCampaign($campaign)
  1819.     {
  1820.         $this->campaign $campaign;
  1821.         return $this;
  1822.     }
  1823.     /**
  1824.      * Get campaign
  1825.      *
  1826.      * @return string
  1827.      */
  1828.     public function getCampaign()
  1829.     {
  1830.         return $this->campaign;
  1831.     }
  1832.     /**
  1833.      * Set campaignChannel
  1834.      *
  1835.      * @param string $campaignChannel
  1836.      * @return User
  1837.      */
  1838.     public function setCampaignChannel($campaignChannel)
  1839.     {
  1840.         $this->campaignChannel $campaignChannel;
  1841.         return $this;
  1842.     }
  1843.     public function getCampaignChannel(): ?string
  1844.     {
  1845.         return $this->campaignChannel;
  1846.     }
  1847.     /**
  1848.      * @return Collection|BraintreeResponse[]
  1849.      */
  1850.     public function getBraintreeResponse(): Collection
  1851.     {
  1852.         return $this->braintreeResponse;
  1853.     }
  1854.     public function addBraintreeResponse(BraintreeResponse $braintreeResponse): self
  1855.     {
  1856.         if (!$this->braintreeResponse->contains($braintreeResponse)) {
  1857.             $this->braintreeResponse[] = $braintreeResponse;
  1858.             $braintreeResponse->setUser($this);
  1859.         }
  1860.         return $this;
  1861.     }
  1862.     public function removeBraintreeResponse(BraintreeResponse $braintreeResponse): self
  1863.     {
  1864.         if ($this->braintreeResponse->contains($braintreeResponse)) {
  1865.             $this->braintreeResponse->removeElement($braintreeResponse);
  1866.             // set the owning side to null (unless already changed)
  1867.             if ($braintreeResponse->getUser() === $this) {
  1868.                 $braintreeResponse->setUser(null);
  1869.             }
  1870.         }
  1871.         return $this;
  1872.     }
  1873.     /**
  1874.      * @return Collection|UserCertificate[]
  1875.      */
  1876.     public function getUserCertificates(): Collection
  1877.     {
  1878.         return $this->userCertificates;
  1879.     }
  1880.     public function addUserCertificate(UserCertificate $userCertificate): self
  1881.     {
  1882.         if (!$this->userCertificates->contains($userCertificate)) {
  1883.             $this->userCertificates[] = $userCertificate;
  1884.             $userCertificate->setUser($this);
  1885.         }
  1886.         return $this;
  1887.     }
  1888.     public function removeUserCertificate(UserCertificate $userCertificate): self
  1889.     {
  1890.         if ($this->userCertificates->contains($userCertificate)) {
  1891.             $this->userCertificates->removeElement($userCertificate);
  1892.             // set the owning side to null (unless already changed)
  1893.             if ($userCertificate->getUser() === $this) {
  1894.                 $userCertificate->setUser(null);
  1895.             }
  1896.         }
  1897.         return $this;
  1898.     }
  1899.     public function getPosition(): ?UserPosition
  1900.     {
  1901.         return $this->position;
  1902.     }
  1903.     public function setPosition(?UserPosition $position): self
  1904.     {
  1905.         $this->position $position;
  1906.         return $this;
  1907.     }
  1908.     public function getAdditionalInformation(): Collection
  1909.     {
  1910.         return $this->additionalInformation;
  1911.     }
  1912.     public function addAdditionalInformation(UserAdditionalInfo $additionalInformation): self
  1913.     {
  1914.         if (!$this->additionalInformation->contains($additionalInformation)) {
  1915.             $this->additionalInformation[] = $additionalInformation;
  1916.             $additionalInformation->setUser($this);
  1917.         }
  1918.         return $this;
  1919.     }
  1920.     public function removeAdditionalInformation(UserAdditionalInfo $additionalInformation): self
  1921.     {
  1922.         if ($this->additionalInformation->contains($additionalInformation)) {
  1923.             $this->additionalInformation->removeElement($additionalInformation);
  1924.             if ($additionalInformation->getUser() === $this) {
  1925.                 $additionalInformation->setUser(null);
  1926.             }
  1927.         }
  1928.         return $this;
  1929.     }
  1930.     public function getMarketing(): ?string
  1931.     {
  1932.         return $this->marketing;
  1933.     }
  1934.     public function setMarketing(?string $marketing): void
  1935.     {
  1936.         $this->marketing $marketing;
  1937.     }
  1938.     /**
  1939.      * @return Collection|UserFiles[]
  1940.      */
  1941.     public function getUserFiles(): Collection
  1942.     {
  1943.         return $this->userFiles;
  1944.     }
  1945.     public function addUserFile(UserFiles $userFile): self
  1946.     {
  1947.         if (!$this->userFiles->contains($userFile)) {
  1948.             $this->userFiles[] = $userFile;
  1949.             $userFile->setUser($this);
  1950.         }
  1951.         return $this;
  1952.     }
  1953.     public function removeUserFile(UserFiles $userFile): self
  1954.     {
  1955.         if ($this->userFiles->contains($userFile)) {
  1956.             $this->userFiles->removeElement($userFile);
  1957.             // set the owning side to null (unless already changed)
  1958.             if ($userFile->getUser() === $this) {
  1959.                 $userFile->setUser(null);
  1960.             }
  1961.         }
  1962.         return $this;
  1963.     }
  1964.     public function getSendReminderActivation(): ?int
  1965.     {
  1966.         return $this->sendReminderActivation;
  1967.     }
  1968.     public function setSendReminderActivation(?int $sendReminderActivation): self
  1969.     {
  1970.         $this->sendReminderActivation $sendReminderActivation;
  1971.         return $this;
  1972.     }
  1973.     public function getEmployeeAccount(): ?bool
  1974.     {
  1975.         return $this->employeeAccount;
  1976.     }
  1977.     public function setEmployeeAccount(?bool $employeeAccount): self
  1978.     {
  1979.         $this->employeeAccount $employeeAccount;
  1980.         return $this;
  1981.     }
  1982.     public function getResettingCode()
  1983.     {
  1984.         return $this->resettingCode;
  1985.     }
  1986.     public function setResettingCode($resettingCode): void
  1987.     {
  1988.         $this->resettingCode $resettingCode;
  1989.     }
  1990.     public function getActivationCode()
  1991.     {
  1992.         return $this->activationCode;
  1993.     }
  1994.     public function setActivationCode($activationCode): void
  1995.     {
  1996.         $this->activationCode $activationCode;
  1997.     }
  1998.     /**
  1999.      * @return mixed
  2000.      */
  2001.     public function getFolders()
  2002.     {
  2003.         return $this->folders;
  2004.     }
  2005.     /**
  2006.      * @param mixed $folders
  2007.      */
  2008.     public function setFolders($folders): void
  2009.     {
  2010.         $this->folders $folders;
  2011.     }
  2012.     /**
  2013.      * @return mixed
  2014.      */
  2015.     public function getSavedArticles()
  2016.     {
  2017.         return $this->savedArticles;
  2018.     }
  2019.     /**
  2020.      * @param mixed $savedArticles
  2021.      */
  2022.     public function setSavedArticles($savedArticles): void
  2023.     {
  2024.         $this->savedArticles $savedArticles;
  2025.     }
  2026.     public function getFoldersArticlesUpdatedAt(): ?\DateTimeInterface
  2027.     {
  2028.         return $this->foldersArticlesUpdatedAt;
  2029.     }
  2030.     public function setFoldersArticlesUpdatedAt(?\DateTimeInterface $foldersArticlesUpdatedAt): self
  2031.     {
  2032.         $this->foldersArticlesUpdatedAt $foldersArticlesUpdatedAt;
  2033.         return $this;
  2034.     }
  2035.     public function getUserNotification(): Collection
  2036.     {
  2037.         return $this->userNotification;
  2038.     }
  2039.     public function hasNotificationForUser(NotificationForUser $notificationForUser): bool
  2040.     {
  2041.         /** @var UserNotification $userNotification */
  2042.         foreach ($this->getUserNotification() as $userNotification)
  2043.         {
  2044.             if ($userNotification->getNotificationForUser() === $notificationForUser)
  2045.             {
  2046.                 return true;
  2047.             }
  2048.         }
  2049.         return false;
  2050.     }
  2051.     public function addUserNotification(UserNotification $userNotification): self
  2052.     {
  2053.         if (!$this->userNotification->contains($userNotification)) {
  2054.             $this->userNotification[] = $userNotification;
  2055.             $userNotification->setUser($this);
  2056.         }
  2057.         return $this;
  2058.     }
  2059.     public function removeUserNotification(userNotification $userNotification): self
  2060.     {
  2061.         if ($this->userNotification->contains($userNotification)) {
  2062.             $this->userNotification->removeElement($userNotification);
  2063.             if ($userNotification->getUser() === $this) {
  2064.                 $userNotification->setUser(null);
  2065.             }
  2066.         }
  2067.         return $this;
  2068.     }
  2069.     /**
  2070.      * @return Collection|FoLog[]
  2071.      */
  2072.     public function getFoLogs(): Collection
  2073.     {
  2074.         return $this->foLogs;
  2075.     }
  2076.     public function addFoLog(FoLog $foLog): self
  2077.     {
  2078.         if (!$this->foLogs->contains($foLog)) {
  2079.             $this->foLogs[] = $foLog;
  2080.             $foLog->setUser($this);
  2081.         }
  2082.         return $this;
  2083.     }
  2084.     public function removeFoLog(FoLog $foLog): self
  2085.     {
  2086.         if ($this->foLogs->contains($foLog)) {
  2087.             $this->foLogs->removeElement($foLog);
  2088.             // set the owning side to null (unless already changed)
  2089.             if ($foLog->getUser() === $this) {
  2090.                 $foLog->setUser(null);
  2091.             }
  2092.         }
  2093.         return $this;
  2094.     }
  2095.     /**
  2096.      * @return Collection|UserCard[]
  2097.      */
  2098.     public function getUserCards(): Collection
  2099.     {
  2100.         return $this->userCards;
  2101.     }
  2102.     public function getActiveUserCardForOrder(Orders $order): ?UserCard
  2103.     {
  2104.         foreach ($this->getUserCards() as $userCard)
  2105.         {
  2106.             if ($userCard->getIsActive() && $userCard->getOrders() === $order)
  2107.             {
  2108.                 return $userCard;
  2109.             }
  2110.         }
  2111.         return null;
  2112.     }
  2113.     public function addUserCard(UserCard $userCard): self
  2114.     {
  2115.         if (!$this->userCards->contains($userCard)) {
  2116.             $this->userCards[] = $userCard;
  2117.             $userCard->setUser($this);
  2118.         }
  2119.         return $this;
  2120.     }
  2121.     public function removeUserCard(UserCard $userCard): self
  2122.     {
  2123.         if ($this->userCards->contains($userCard)) {
  2124.             $this->userCards->removeElement($userCard);
  2125.             // set the owning side to null (unless already changed)
  2126.             if ($userCard->getUser() === $this) {
  2127.                 $userCard->setUser(null);
  2128.             }
  2129.         }
  2130.         return $this;
  2131.     }
  2132.     /**
  2133.      * @return Collection|UserVideoNotes[]
  2134.      */
  2135.     public function getUserVideoNotes(): Collection
  2136.     {
  2137.         return $this->userVideoNotes;
  2138.     }
  2139.     public function addUserVideoNote(UserVideoNotes $userVideoNote): self
  2140.     {
  2141.         if (!$this->userVideoNotes->contains($userVideoNote)) {
  2142.             $this->userVideoNotes[] = $userVideoNote;
  2143.             $userVideoNote->setUser($this);
  2144.         }
  2145.         return $this;
  2146.     }
  2147.     public function removeUserVideoNote(UserVideoNotes $userVideoNote): self
  2148.     {
  2149.         if ($this->userVideoNotes->contains($userVideoNote)) {
  2150.             $this->userVideoNotes->removeElement($userVideoNote);
  2151.             // set the owning side to null (unless already changed)
  2152.             if ($userVideoNote->getUser() === $this) {
  2153.                 $userVideoNote->setUser(null);
  2154.             }
  2155.         }
  2156.         return $this;
  2157.     }
  2158.     /**
  2159.      * @return Collection|EventNotificationScheduler[]
  2160.      */
  2161.     public function getEventNotificationSchedulers(): Collection
  2162.     {
  2163.         return $this->eventNotificationSchedulers;
  2164.     }
  2165.     public function addEventNotificationScheduler(EventNotificationScheduler $eventNotificationScheduler): self
  2166.     {
  2167.         if (!$this->eventNotificationSchedulers->contains($eventNotificationScheduler)) {
  2168.             $this->eventNotificationSchedulers[] = $eventNotificationScheduler;
  2169.             $eventNotificationScheduler->setUser($this);
  2170.         }
  2171.         return $this;
  2172.     }
  2173.     public function removeEventNotificationScheduler(EventNotificationScheduler $eventNotificationScheduler): self
  2174.     {
  2175.         if ($this->eventNotificationSchedulers->contains($eventNotificationScheduler)) {
  2176.             $this->eventNotificationSchedulers->removeElement($eventNotificationScheduler);
  2177.             // set the owning side to null (unless already changed)
  2178.             if ($eventNotificationScheduler->getUser() === $this) {
  2179.                 $eventNotificationScheduler->setUser(null);
  2180.             }
  2181.         }
  2182.         return $this;
  2183.     }
  2184.     /**
  2185.      * @return Collection|Events[]
  2186.      */
  2187.     public function getPresenceOnEvents(): Collection
  2188.     {
  2189.         return $this->presenceOnEvents;
  2190.     }
  2191.     public function addPresenceOnEvent(Events $event): self
  2192.     {
  2193.         if (!$this->presenceOnEvents->contains($event))
  2194.         {
  2195.             $this->presenceOnEvents[] = $event;
  2196.             $event->addPresentUser($this);
  2197.         }
  2198.         return $this;
  2199.     }
  2200.     public function removePresenceOnEvent(Events $event): self
  2201.     {
  2202.         if ($this->presenceOnEvents->contains($event))
  2203.         {
  2204.             $this->presenceOnEvents->removeElement($event);
  2205.             $event->removePresentUser($this);
  2206.         }
  2207.         return $this;
  2208.     }
  2209.     public function getOneTimePassword(): ?string
  2210.     {
  2211.         return $this->oneTimePassword;
  2212.     }
  2213.     public function setOneTimePassword(?string $oneTimePassword): self
  2214.     {
  2215.         $this->oneTimePassword $oneTimePassword;
  2216.         return $this;
  2217.     }
  2218.     public function getOtpToken(): ?string
  2219.     {
  2220.         return $this->otpToken;
  2221.     }
  2222.     public function setOtpToken(?string $otpToken): self
  2223.     {
  2224.         $this->otpToken $otpToken;
  2225.         return $this;
  2226.     }
  2227.     /**
  2228.      * @return Collection|UserFirstLoginInfo[]
  2229.      */
  2230.     public function getUserFirstLoginInfos(): Collection
  2231.     {
  2232.         return $this->userFirstLoginInfos;
  2233.     }
  2234.     public function addUserFirstLoginInfo(UserFirstLoginInfo $userFirstLoginInfo): self
  2235.     {
  2236.         if (!$this->userFirstLoginInfos->contains($userFirstLoginInfo)) {
  2237.             $this->userFirstLoginInfos[] = $userFirstLoginInfo;
  2238.             $userFirstLoginInfo->setUser($this);
  2239.         }
  2240.         return $this;
  2241.     }
  2242.     public function removeUserFirstLoginInfo(UserFirstLoginInfo $userFirstLoginInfo): self
  2243.     {
  2244.         if ($this->userFirstLoginInfos->contains($userFirstLoginInfo)) {
  2245.             $this->userFirstLoginInfos->removeElement($userFirstLoginInfo);
  2246.             // set the owning side to null (unless already changed)
  2247.             if ($userFirstLoginInfo->getUser() === $this) {
  2248.                 $userFirstLoginInfo->setUser(null);
  2249.             }
  2250.         }
  2251.         return $this;
  2252.     }
  2253.     /**
  2254.      * @return Collection|UserDevices[]
  2255.      */
  2256.     public function getUserDevices(): Collection
  2257.     {
  2258.         return $this->userDevices;
  2259.     }
  2260.     public function addUserDevice(UserDevices $userDevice): self
  2261.     {
  2262.         if (!$this->userDevices->contains($userDevice)) {
  2263.             $this->userDevices[] = $userDevice;
  2264.             $userDevice->setUser($this);
  2265.         }
  2266.         return $this;
  2267.     }
  2268.     public function removeUserDevice(UserDevices $userDevice): self
  2269.     {
  2270.         if ($this->userDevices->contains($userDevice)) {
  2271.             $this->userDevices->removeElement($userDevice);
  2272.             // set the owning side to null (unless already changed)
  2273.             if ($userDevice->getUser() === $this) {
  2274.                 $userDevice->setUser(null);
  2275.             }
  2276.         }
  2277.         return $this;
  2278.     }
  2279.     public function getDeviceAuthCode(): ?string
  2280.     {
  2281.         return $this->deviceAuthCode;
  2282.     }
  2283.     public function setDeviceAuthCode(?string $deviceAuthCode): self
  2284.     {
  2285.         $this->deviceAuthCode $deviceAuthCode;
  2286.         return $this;
  2287.     }
  2288.     public function getDeviceAuthToken(): ?string
  2289.     {
  2290.         return $this->deviceAuthToken;
  2291.     }
  2292.     public function setDeviceAuthToken(?string $deviceAuthToken): self
  2293.     {
  2294.         $this->deviceAuthToken $deviceAuthToken;
  2295.         return $this;
  2296.     }
  2297.     /**
  2298.      * @return Collection|VirtualCurrencyWallet[]
  2299.      */
  2300.     public function getVirtualCurrencyWallets(): Collection
  2301.     {
  2302.         return $this->virtualCurrencyWallets;
  2303.     }
  2304.     public function addVirtualCurrencyWallet(VirtualCurrencyWallet $virtualCurrencyWallet): self
  2305.     {
  2306.         if (!$this->virtualCurrencyWallets->contains($virtualCurrencyWallet)) {
  2307.             $this->virtualCurrencyWallets[] = $virtualCurrencyWallet;
  2308.             $virtualCurrencyWallet->setUser($this);
  2309.         }
  2310.         return $this;
  2311.     }
  2312.     public function removeVirtualCurrencyWallet(VirtualCurrencyWallet $virtualCurrencyWallet): self
  2313.     {
  2314.         if ($this->virtualCurrencyWallets->contains($virtualCurrencyWallet)) {
  2315.             $this->virtualCurrencyWallets->removeElement($virtualCurrencyWallet);
  2316.             // set the owning side to null (unless already changed)
  2317.             if ($virtualCurrencyWallet->getUser() === $this) {
  2318.                 $virtualCurrencyWallet->setUser(null);
  2319.             }
  2320.         }
  2321.         return $this;
  2322.     }
  2323.     /**
  2324.      * @return Collection|VirtualCurrencyTransaction[]
  2325.      */
  2326.     public function getVirtualCurrencyTransactions(): Collection
  2327.     {
  2328.         return $this->virtualCurrencyTransactions;
  2329.     }
  2330.     public function addVirtualCurrencyTransaction(VirtualCurrencyTransaction $virtualCurrencyTransaction): self
  2331.     {
  2332.         if (!$this->virtualCurrencyTransactions->contains($virtualCurrencyTransaction)) {
  2333.             $this->virtualCurrencyTransactions[] = $virtualCurrencyTransaction;
  2334.             $virtualCurrencyTransaction->setUser($this);
  2335.         }
  2336.         return $this;
  2337.     }
  2338.     public function removeVirtualCurrencyTransaction(VirtualCurrencyTransaction $virtualCurrencyTransaction): self
  2339.     {
  2340.         if ($this->virtualCurrencyTransactions->contains($virtualCurrencyTransaction)) {
  2341.             $this->virtualCurrencyTransactions->removeElement($virtualCurrencyTransaction);
  2342.             // set the owning side to null (unless already changed)
  2343.             if ($virtualCurrencyTransaction->getUser() === $this) {
  2344.                 $virtualCurrencyTransaction->setUser(null);
  2345.             }
  2346.         }
  2347.         return $this;
  2348.     }
  2349.     /**
  2350.      * @return Collection|VirtualCurrencyOrder[]
  2351.      */
  2352.     public function getVirtualCurrencyOrders(): Collection
  2353.     {
  2354.         return $this->virtualCurrencyOrders;
  2355.     }
  2356.     public function addVirtualCurrencyOrder(VirtualCurrencyOrder $virtualCurrencyOrder): self
  2357.     {
  2358.         if (!$this->virtualCurrencyOrders->contains($virtualCurrencyOrder)) {
  2359.             $this->virtualCurrencyOrders[] = $virtualCurrencyOrder;
  2360.             $virtualCurrencyOrder->setUser($this);
  2361.         }
  2362.         return $this;
  2363.     }
  2364.     public function removeVirtualCurrencyOrder(VirtualCurrencyOrder $virtualCurrencyOrder): self
  2365.     {
  2366.         if ($this->virtualCurrencyOrders->contains($virtualCurrencyOrder)) {
  2367.             $this->virtualCurrencyOrders->removeElement($virtualCurrencyOrder);
  2368.             // set the owning side to null (unless already changed)
  2369.             if ($virtualCurrencyOrder->getUser() === $this) {
  2370.                 $virtualCurrencyOrder->setUser(null);
  2371.             }
  2372.         }
  2373.         return $this;
  2374.     }
  2375.     /**
  2376.      * @return Collection|SmsCode[]
  2377.      */
  2378.     public function getSmsCodes(): Collection
  2379.     {
  2380.         return $this->smsCodes;
  2381.     }
  2382.     public function addSmsCode(SmsCode $smsCode): self
  2383.     {
  2384.         if (!$this->smsCodes->contains($smsCode)) {
  2385.             $this->smsCodes[] = $smsCode;
  2386.             $smsCode->setUser($this);
  2387.         }
  2388.         return $this;
  2389.     }
  2390.     public function removeSmsCode(SmsCode $smsCode): self
  2391.     {
  2392.         if ($this->smsCodes->contains($smsCode)) {
  2393.             $this->smsCodes->removeElement($smsCode);
  2394.             // set the owning side to null (unless already changed)
  2395.             if ($smsCode->getUser() === $this) {
  2396.                 $smsCode->setUser(null);
  2397.             }
  2398.         }
  2399.         return $this;
  2400.     }
  2401.     public function findUserPhoneNumber(): ?string
  2402.     {
  2403.         if ($this->phoneNumber)
  2404.         {
  2405.             return $this->phoneNumber;
  2406.         }
  2407.         if ($this->getAddress() && $this->getAddress()->getPhone())
  2408.         {
  2409.             return $this->getAddress()->getPhone();
  2410.         }
  2411.         return null;
  2412.     }
  2413.     /**
  2414.      * @return Collection|Email[]
  2415.      */
  2416.     public function getEmails(): Collection
  2417.     {
  2418.         return $this->emails;
  2419.     }
  2420.     public function addEmail(Email $email): self
  2421.     {
  2422.         if (!$this->emails->contains($email)) {
  2423.             $this->emails[] = $email;
  2424.             $email->setUser($this);
  2425.         }
  2426.         return $this;
  2427.     }
  2428.     public function removeEmail(Email $email): self
  2429.     {
  2430.         if ($this->emails->contains($email)) {
  2431.             $this->emails->removeElement($email);
  2432.             // set the owning side to null (unless already changed)
  2433.             if ($email->getUser() === $this) {
  2434.                 $email->setUser(null);
  2435.             }
  2436.         }
  2437.         return $this;
  2438.     }
  2439.     /**
  2440.      * @return Collection|LoginHistory[]
  2441.      */
  2442.     public function getLoginHistories(): Collection
  2443.     {
  2444.         return $this->loginHistories;
  2445.     }
  2446.     public function addLoginHistory(LoginHistory $loginHistory): self
  2447.     {
  2448.         if (!$this->loginHistories->contains($loginHistory)) {
  2449.             $this->loginHistories[] = $loginHistory;
  2450.             $loginHistory->setUser($this);
  2451.         }
  2452.         return $this;
  2453.     }
  2454.     public function removeLoginHistory(LoginHistory $loginHistory): self
  2455.     {
  2456.         if ($this->loginHistories->contains($loginHistory)) {
  2457.             $this->loginHistories->removeElement($loginHistory);
  2458.             // set the owning side to null (unless already changed)
  2459.             if ($loginHistory->getUser() === $this) {
  2460.                 $loginHistory->setUser(null);
  2461.             }
  2462.         }
  2463.         return $this;
  2464.     }
  2465.     /**
  2466.      * @return Collection|UserCertificatePath[]
  2467.      */
  2468.     public function getUserCertificatePaths(): Collection
  2469.     {
  2470.         return $this->userCertificatePaths;
  2471.     }
  2472.     public function addUserCertificatePath(UserCertificatePath $userCertificatePath): self
  2473.     {
  2474.         if (!$this->userCertificatePaths->contains($userCertificatePath)) {
  2475.             $this->userCertificatePaths[] = $userCertificatePath;
  2476.             $userCertificatePath->setUser($this);
  2477.         }
  2478.         return $this;
  2479.     }
  2480.     public function removeUserCertificatePath(UserCertificatePath $userCertificatePath): self
  2481.     {
  2482.         if ($this->userCertificatePaths->contains($userCertificatePath)) {
  2483.             $this->userCertificatePaths->removeElement($userCertificatePath);
  2484.             // set the owning side to null (unless already changed)
  2485.             if ($userCertificatePath->getUser() === $this) {
  2486.                 $userCertificatePath->setUser(null);
  2487.             }
  2488.         }
  2489.         return $this;
  2490.     }
  2491.     /**
  2492.      * @return Collection|ProductReleaseNotify[]
  2493.      */
  2494.     public function getProductReleaseNotifies(): Collection
  2495.     {
  2496.         return $this->productReleaseNotifies;
  2497.     }
  2498.     public function addProductReleaseNotify(ProductReleaseNotify $productReleaseNotify): self
  2499.     {
  2500.         if (!$this->productReleaseNotifies->contains($productReleaseNotify)) {
  2501.             $this->productReleaseNotifies[] = $productReleaseNotify;
  2502.             $productReleaseNotify->setUser($this);
  2503.         }
  2504.         return $this;
  2505.     }
  2506.     public function removeProductReleaseNotify(ProductReleaseNotify $productReleaseNotify): self
  2507.     {
  2508.         if ($this->productReleaseNotifies->contains($productReleaseNotify)) {
  2509.             $this->productReleaseNotifies->removeElement($productReleaseNotify);
  2510.             // set the owning side to null (unless already changed)
  2511.             if ($productReleaseNotify->getUser() === $this) {
  2512.                 $productReleaseNotify->setUser(null);
  2513.             }
  2514.         }
  2515.         return $this;
  2516.     }
  2517.     public function getLastFailureDiaboloResponseAt(): ?\DateTimeInterface
  2518.     {
  2519.         return $this->lastFailureDiaboloResponseAt;
  2520.     }
  2521.     public function setLastFailureDiaboloResponseAt(?\DateTimeInterface $lastFailureDiaboloResponseAt): self
  2522.     {
  2523.         $this->lastFailureDiaboloResponseAt $lastFailureDiaboloResponseAt;
  2524.         return $this;
  2525.     }
  2526.     /**
  2527.      * @return Collection|UserRenewalOffer[]
  2528.      */
  2529.     public function getUserRenewalOffers(): Collection
  2530.     {
  2531.         return $this->userRenewalOffers;
  2532.     }
  2533.     public function addUserRenewalOffer(UserRenewalOffer $userRenewalOffer): self
  2534.     {
  2535.         if (!$this->userRenewalOffers->contains($userRenewalOffer)) {
  2536.             $this->userRenewalOffers[] = $userRenewalOffer;
  2537.             $userRenewalOffer->setUser($this);
  2538.         }
  2539.         return $this;
  2540.     }
  2541.     public function removeUserRenewalOffer(UserRenewalOffer $userRenewalOffer): self
  2542.     {
  2543.         if ($this->userRenewalOffers->contains($userRenewalOffer)) {
  2544.             $this->userRenewalOffers->removeElement($userRenewalOffer);
  2545.             // set the owning side to null (unless already changed)
  2546.             if ($userRenewalOffer->getUser() === $this) {
  2547.                 $userRenewalOffer->setUser(null);
  2548.             }
  2549.         }
  2550.         return $this;
  2551.     }
  2552.     public function getUsingPortals(): Collection
  2553.     {
  2554.         return $this->usingPortals;
  2555.     }
  2556.     public function addUsingPortal(PortalSettings $usingPortal): self
  2557.     {
  2558.         if (!$this->usingPortals->contains($usingPortal)) {
  2559.             $this->usingPortals[] = $usingPortal;
  2560.         }
  2561.         return $this;
  2562.     }
  2563.     public function removeUsingPortal(PortalSettings $usingPortal): self
  2564.     {
  2565.         if ($this->usingPortals->contains($usingPortal)) {
  2566.             $this->usingPortals->removeElement($usingPortal);
  2567.         }
  2568.         return $this;
  2569.     }
  2570.     /**
  2571.      * @return Collection|AssignedUserFlag[]
  2572.      */
  2573.     public function getAssignedFlags(): Collection
  2574.     {
  2575.         return $this->assignedFlags;
  2576.     }
  2577.     public function addAssignedFlag(AssignedUserFlag $assignedFlag): self
  2578.     {
  2579.         if (!$this->assignedFlags->contains($assignedFlag)) {
  2580.             $this->assignedFlags[] = $assignedFlag;
  2581.             $assignedFlag->setUser($this);
  2582.         }
  2583.         return $this;
  2584.     }
  2585.     public function removeAssignedFlag(AssignedUserFlag $assignedFlag): self
  2586.     {
  2587.         if ($this->assignedFlags->contains($assignedFlag)) {
  2588.             $this->assignedFlags->removeElement($assignedFlag);
  2589.             // set the owning side to null (unless already changed)
  2590.             if ($assignedFlag->getUser() === $this) {
  2591.                 $assignedFlag->setUser(null);
  2592.             }
  2593.         }
  2594.         return $this;
  2595.     }
  2596.     /**
  2597.      * @return Collection|OrderProductVariantOmittedUpsell[]
  2598.      */
  2599.     public function getOrderProductVariantOmittedUpsells(): Collection
  2600.     {
  2601.         return $this->orderProductVariantOmittedUpsells;
  2602.     }
  2603.     public function addOrderProductVariantOmittedUpsell(OrderProductVariantOmittedUpsell $orderProductVariantOmittedUpsell): self
  2604.     {
  2605.         if (!$this->orderProductVariantOmittedUpsells->contains($orderProductVariantOmittedUpsell)) {
  2606.             $this->orderProductVariantOmittedUpsells[] = $orderProductVariantOmittedUpsell;
  2607.             $orderProductVariantOmittedUpsell->setUser($this);
  2608.         }
  2609.         return $this;
  2610.     }
  2611.     public function removeOrderProductVariantOmittedUpsell(OrderProductVariantOmittedUpsell $orderProductVariantOmittedUpsell): self
  2612.     {
  2613.         if ($this->orderProductVariantOmittedUpsells->contains($orderProductVariantOmittedUpsell)) {
  2614.             $this->orderProductVariantOmittedUpsells->removeElement($orderProductVariantOmittedUpsell);
  2615.             // set the owning side to null (unless already changed)
  2616.             if ($orderProductVariantOmittedUpsell->getUser() === $this) {
  2617.                 $orderProductVariantOmittedUpsell->setUser(null);
  2618.             }
  2619.         }
  2620.         return $this;
  2621.     }
  2622.     public function getNpwz(): ?int
  2623.     {
  2624.         return $this->npwz;
  2625.     }
  2626.     public function setNpwz(?int $npwz): self
  2627.     {
  2628.         $this->npwz $npwz;
  2629.         return $this;
  2630.     }
  2631.     public function isDarkModeActive(): ?bool
  2632.     {
  2633.         return $this->isDarkModeActive;
  2634.     }
  2635.     public function setIsDarkModeActive(int $isDarkModeActive): User
  2636.     {
  2637.         $this->isDarkModeActive $isDarkModeActive;
  2638.         return $this;
  2639.     }
  2640.     public function getGetResponseContactId(): ?string
  2641.     {
  2642.         return $this->getResponseContactId;
  2643.     }
  2644.     public function setGetResponseContactId(?string $getResponseContactId): self
  2645.     {
  2646.         $this->getResponseContactId $getResponseContactId;
  2647.         return $this;
  2648.     }
  2649.     /**
  2650.      * @return mixed
  2651.      */
  2652.     public function getIsRobinson()
  2653.     {
  2654.         return $this->isRobinson;
  2655.     }
  2656.     /**
  2657.      * @param mixed $isRobinson
  2658.      * @return User
  2659.      */
  2660.     public function setIsRobinson($isRobinson)
  2661.     {
  2662.         $this->isRobinson $isRobinson;
  2663.         return $this;
  2664.     }
  2665.     public function getSalesmanago2ContactId(): ?string
  2666.     {
  2667.         return $this->salesmanago2ContactId;
  2668.     }
  2669.     public function setSalesmanago2ContactId(?string $salesmanago2ContactId): self
  2670.     {
  2671.         $this->salesmanago2ContactId $salesmanago2ContactId;
  2672.         return $this;
  2673.     }
  2674.     public function existsInDb(): bool
  2675.     {
  2676.         try
  2677.         {
  2678.             $this->getEmail();
  2679.         }
  2680.         catch (EntityNotFoundException $e)
  2681.         {
  2682.             return false;
  2683.         }
  2684.         return true;
  2685.     }
  2686. }