src/Entity/Data/User.php line 25

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Data;
  3. use App\Repository\Data\UserRepository;
  4. use App\Entity\System\Country;
  5. use App\Service\Helper;
  6. use App\Traits\TimestampableTrait;
  7. use Doctrine\Common\Collections\ArrayCollection;
  8. use Doctrine\Common\Collections\Collection;
  9. use Doctrine\ORM\Event\LifecycleEventArgs;
  10. use Doctrine\ORM\Mapping as ORM;
  11. use Symfony\Component\Security\Core\User\EquatableInterface;
  12. use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface;
  13. use Symfony\Component\Security\Core\User\UserInterface;
  14. use App\Validator as AppAssert;
  15. use Symfony\Component\Validator\Constraints as Assert;
  16. /**
  17.  * @ORM\Entity(repositoryClass=UserRepository::class)
  18.  * @ORM\Table(name="`user`")
  19.  * @ORM\HasLifecycleCallbacks()
  20.  * @AppAssert\UserEmail(groups={"register", "profile"})
  21.  */
  22. class User implements UserInterfaceEquatableInterfacePasswordAuthenticatedUserInterface
  23. {
  24.     use TimestampableTrait;
  25.     /**
  26.      * @ORM\Id
  27.      * @ORM\GeneratedValue
  28.      * @ORM\Column(type="integer")
  29.      */
  30.     private ?int $id;
  31.     /**
  32.      * @ORM\Column(type="string", length=180, unique=true)
  33.      * @Assert\NotNull(message="validate.field.empty")
  34.      * @Assert\Email()
  35.      */
  36.     private ?string $email;
  37.     /**
  38.      * @ORM\Column(type="json")
  39.      */
  40.     private array $roles;
  41.     /**
  42.      * @var string The hashed password
  43.      * @ORM\Column(type="string")
  44.      */
  45.     private string $password;
  46.     /**
  47.      * @var string|null Plain password
  48.      * @Assert\NotNull(groups={"register", "recover_password"}, message="validate.field.empty")
  49.      * @AppAssert\PasswordStrength(min=8, is_pwned=true, rules={"digit", "special", "lower_letter", "upper_letter"})
  50.      */
  51.     private ?string $newPassword;
  52.     /**
  53.      * @ORM\ManyToOne(targetEntity=UserGroup::class, inversedBy="users")
  54.      */
  55.     private $userGroup;
  56.     /**
  57.      * @ORM\OneToMany(targetEntity=Company::class, mappedBy="user")
  58.      */
  59.     private $companies;
  60.     /**
  61.      * @ORM\ManyToOne(targetEntity=Referer::class, inversedBy="users")
  62.      */
  63.     private $referer;
  64.     /**
  65.      * @ORM\Column(type="string", length=5, nullable=true)
  66.      */
  67.     private $locale;
  68.     /**
  69.      * @ORM\Column(type="string", length=20, nullable=true)
  70.      * @Assert\NotNull(message="validate.field.empty", groups="register2")
  71.      * @AppAssert\Phone(message="validate.format.wrong", groups="register2")
  72.      */
  73.     private $mobile;
  74.     /**
  75.      * @ORM\Column(type="string", length=255, nullable=true)
  76.      */
  77.     private $securityQuestion1;
  78.     /**
  79.      * @ORM\Column(type="string", length=255, nullable=true)
  80.      */
  81.     private $securityAnswer1;
  82.     private $newSecurityAnswer1;
  83.     /**
  84.      * @ORM\Column(type="string", length=255, nullable=true)
  85.      */
  86.     private $securityQuestion2;
  87.     /**
  88.      * @ORM\Column(type="string", length=255, nullable=true)
  89.      */
  90.     private $securityAnswer2;
  91.     private $newSecurityAnswer2;
  92.     /**
  93.      * @ORM\Column(type="string", length=255, nullable=true)
  94.      * @Assert\Email(groups="register2")
  95.      * @AppAssert\UserEmailAlternative(groups="register2")
  96.      */
  97.     private $emailAlternative;
  98.     /**
  99.      * @ORM\Column(type="string", length=30, nullable=true)
  100.      */
  101.     private $lastIp;
  102.     /**
  103.      * @ORM\Column(type="string", length=255, nullable=true)
  104.      */
  105.     private $lastGeoCity;
  106.     /**
  107.      * @ORM\Column(type="string", length=2, nullable=true)
  108.      */
  109.     private $lastGeoCountryId;
  110.     /** @var Country */
  111.     private $lastGeoCountry;
  112.     /**
  113.      * @ORM\Column(type="datetime", nullable=true)
  114.      */
  115.     private $lastLoginOn;
  116.     /**
  117.      * @ORM\Column(type="datetime", nullable=true)
  118.      */
  119.     private $deletedOn;
  120.     /**
  121.      * @ORM\Column(type="integer", nullable=true)
  122.      */
  123.     private $failedLoginCount;
  124.     /**
  125.      * @ORM\Column(type="string", length=255, nullable=true)
  126.      */
  127.     private $lastSecurityType;
  128.     /**
  129.      * @ORM\Column(type="string", length=20, nullable=true)
  130.      */
  131.     private $salutation;
  132.     /**
  133.      * @ORM\Column(type="string", length=255, nullable=true)
  134.      */
  135.     private $title;
  136.     /**
  137.      * @ORM\Column(type="string", length=255, nullable=true)
  138.      * @Assert\NotNull(groups={"profile"})
  139.      */
  140.     private $firstName;
  141.     /**
  142.      * @ORM\Column(type="string", length=255, nullable=true)
  143.      * @Assert\NotNull(groups={"profile"})
  144.      */
  145.     private $lastName;
  146.     /**
  147.      * @ORM\Column(type="string", length=255, nullable=true)
  148.      */
  149.     private $emailConfirmationCode;
  150.     /**
  151.      * @ORM\Column(type="datetime", nullable=true)
  152.      */
  153.     private $emailConfirmationExpiryOn;
  154.     /**
  155.      * @ORM\Column(type="boolean", nullable=true)
  156.      */
  157.     private $isEmailConfirmed;
  158.     /**
  159.      * @ORM\Column(type="string", length=255, nullable=true)
  160.      */
  161.     private $recoverPasswordCode;
  162.     /**
  163.      * @ORM\Column(type="datetime", nullable=true)
  164.      */
  165.     private $recoverPasswordCodeExpiryOn;
  166.     /**
  167.      * @var string|null
  168.      *
  169.      * @ORM\Column(type="string", length=100, nullable=true)
  170.      */
  171.     private $emailResendRequestCode;
  172.     /**
  173.      * @var \DateTime|null
  174.      *
  175.      * @ORM\Column(type="datetime", nullable=true)
  176.      */
  177.     private $emailResendRequestCodeExpiryOn;
  178.     /**
  179.      * @ORM\Column(type="string", length=10, nullable=true)
  180.      */
  181.     private $otp;
  182.     /**
  183.      * @Assert\Expression("this.getOtp() === value", groups="register3")
  184.      * @Assert\NotNull(groups="register3")
  185.      */
  186.     private $otpNew;
  187.     /**
  188.      * @ORM\Column(type="string", length=255, nullable=true)
  189.      */
  190.     private $maidenName;
  191.     /**
  192.      * @ORM\Column(type="string", length=1, nullable=true)
  193.      */
  194.     private $gender;
  195.     /**
  196.      * @ORM\Column(type="date", nullable=true)
  197.      */
  198.     private $birthDate;
  199.     /**
  200.      * @ORM\Column(type="string", length=2, nullable=true)
  201.      */
  202.     private $birthCountryId;
  203.     /** @var Country */
  204.     private $birthCountry;
  205.     /**
  206.      * @ORM\Column(type="string", length=255, nullable=true)
  207.      */
  208.     private $birthPlace;
  209.     /**
  210.      * @ORM\Column(type="string", length=2, nullable=true)
  211.      */
  212.     private $nationalityId;
  213.     /** @var Country */
  214.     private $nationality;
  215.     /**
  216.      * @ORM\Column(type="string", length=2, nullable=true)
  217.      */
  218.     private $nationalityFormerId;
  219.     /** @var Country */
  220.     private $nationalityFormer;
  221.     /**
  222.      * @ORM\Column(type="string", length=2, nullable=true)
  223.      */
  224.     private $nationalityAdditionalId;
  225.     /** @var Country */
  226.     private $nationalityAdditional;
  227.     /**
  228.      * @ORM\Column(type="string", length=2, nullable=true)
  229.      */
  230.     private $localeAdditional;
  231.     /**
  232.      * User constructor.
  233.      */
  234.     public function __construct()
  235.     {
  236.         $this->roles = [];
  237.         $this->isEmailConfirmed false;
  238.         $this->companies = new ArrayCollection();
  239.     }
  240.     public function isEqualTo(UserInterface $user): bool
  241.     {
  242.         if (!$user instanceof User) {
  243.             return false;
  244.         }
  245.         if ($this->id !== $user->getId()) {
  246.             return false;
  247.         }
  248.         return true;
  249.     }
  250.     /**
  251.      * @ORM\PostLoad()
  252.      */
  253.     public function loadLinkedEntities($event) {
  254. //        $s = '';
  255.     }
  256.     /**
  257.      * @ORM\PostPersist()
  258.      */
  259.     public function saveLinkedEntities(LifecycleEventArgs $event) {
  260. //        $em = $event->getEntityManager();
  261.     }
  262.     public function getId(): ?int
  263.     {
  264.         return $this->id;
  265.     }
  266.     public function getEmail(): ?string
  267.     {
  268.         return $this->email;
  269.     }
  270.     public function setEmail(string $email): self
  271.     {
  272.         $this->email strtolower($email);
  273.         return $this;
  274.     }
  275.     public function getUrlEmail() {
  276.         return base64_encode($this->email);
  277.     }
  278.     public static function urlEmailDecode($email) : string {
  279.         return base64_decode($email);
  280.     }
  281.     /**
  282.      * A visual identifier that represents this user.
  283.      *
  284.      * @see UserInterface
  285.      */
  286.     public function getUsername(): string
  287.     {
  288.         return (string) $this->email;
  289.     }
  290.     /**
  291.      * @see UserInterface
  292.      */
  293.     public function getRoles(): array
  294.     {
  295.         $roles $this->roles;
  296.         $roles[] = 'ROLE_USER';
  297.         return array_unique($roles);
  298.     }
  299.     public function setRoles(array $roles): self
  300.     {
  301.         $this->roles $roles;
  302.         return $this;
  303.     }
  304.     public function addRole($role) {
  305.         if (strpos($role'ROLE_') !== 0) {
  306.             $role 'ROLE_' $role;
  307.         }
  308.         $this->roles[] = $role;
  309.     }
  310.     public function removeRole($role) {
  311.         if (strpos($role'ROLE_') !== 0) {
  312.             $role 'ROLE_' $role;
  313.         }
  314.         if (in_array($role$this->roles)) {
  315.             $key array_search($role$this->roles);
  316.             if ($key !== false) {
  317.                 unset($this->roles[$key]);
  318.             }
  319.         }
  320.         $this->roles array_values($this->roles);
  321.     }
  322.     public function hasRole($role) {
  323.         if (strpos($role'ROLE_') !== 0) {
  324.             $role 'ROLE_' $role;
  325.         }
  326.         return in_array($role$this->roles);
  327.     }
  328.     /**
  329.      * @see UserInterface
  330.      */
  331.     public function getPassword(): string
  332.     {
  333.         return (string) $this->password;
  334.     }
  335.     public function setPassword(string $password): self
  336.     {
  337.         $this->password $password;
  338.         return $this;
  339.     }
  340.     /**
  341.      * Returning a salt is only needed, if you are not using a modern
  342.      * hashing algorithm (e.g. bcrypt or sodium) in your security.yaml.
  343.      *
  344.      * @see UserInterface
  345.      */
  346.     public function getSalt(): ?string
  347.     {
  348.         return null;
  349.     }
  350.     /**
  351.      * @see UserInterface
  352.      */
  353.     public function eraseCredentials()
  354.     {
  355.         // If you store any temporary, sensitive data on the user, clear it here
  356.         // $this->plainPassword = null;
  357.     }
  358.     public function getUserGroup(): ?UserGroup
  359.     {
  360.         return $this->userGroup;
  361.     }
  362.     public function setUserGroup(?UserGroup $userGroup): self
  363.     {
  364.         $this->userGroup $userGroup;
  365.         return $this;
  366.     }
  367.     /**
  368.      * @return Collection|self[]
  369.      */
  370.     public function getCompanies(): Collection
  371.     {
  372.         return $this->companies;
  373.     }
  374.     public function addCompany(Company $company): self
  375.     {
  376.         if (!$this->companies->contains($company)) {
  377.             $this->companies[] = $company;
  378.             $company->setUser($this);
  379.         }
  380.         return $this;
  381.     }
  382.     public function removeCompany(Company $company): self
  383.     {
  384.         if ($this->companies->removeElement($company)) {
  385.             // set the owning side to null (unless already changed)
  386.             if ($company->getUser() === $this) {
  387.                 $company->setUser(null);
  388.             }
  389.         }
  390.         return $this;
  391.     }
  392.     public function getReferer(): ?Referer
  393.     {
  394.         return $this->referer;
  395.     }
  396.     public function setUserReferer(?Referer $referer): self
  397.     {
  398.         $this->referer $referer;
  399.         return $this;
  400.     }
  401.     public function getLocale(): ?string
  402.     {
  403.         return $this->locale;
  404.     }
  405.     public function setLocale(?string $locale): self
  406.     {
  407.         $this->locale $locale;
  408.         return $this;
  409.     }
  410.     public function getMobile(): ?string
  411.     {
  412.         return $this->mobile;
  413.     }
  414.     public function setMobile(?string $mobile): self
  415.     {
  416.         $this->mobile $mobile;
  417.         return $this;
  418.     }
  419.     public function getSecurityQuestion1(): ?string
  420.     {
  421.         return $this->securityQuestion1;
  422.     }
  423.     public function setSecurityQuestion1(?string $securityQuestion1): self
  424.     {
  425.         $this->securityQuestion1 $securityQuestion1;
  426.         return $this;
  427.     }
  428.     public function getSecurityAnswer1(): ?string
  429.     {
  430.         return $this->securityAnswer1;
  431.     }
  432.     public function setSecurityAnswer1(?string $securityAnswer1): self
  433.     {
  434.         $this->securityAnswer1 $securityAnswer1;
  435.         return $this;
  436.     }
  437.     /**
  438.      * @return mixed
  439.      */
  440.     public function getNewSecurityAnswer1()
  441.     {
  442.         return $this->newSecurityAnswer1;
  443.     }
  444.     /**
  445.      * @param mixed $newSecurityAnswer1
  446.      */
  447.     public function setNewSecurityAnswer1($newSecurityAnswer1): void
  448.     {
  449.         $this->newSecurityAnswer1 $newSecurityAnswer1;
  450.     }
  451.     public function getSecurityQuestion2(): ?string
  452.     {
  453.         return $this->securityQuestion2;
  454.     }
  455.     public function setSecurityQuestion2(?string $securityQuestion2): self
  456.     {
  457.         $this->securityQuestion2 $securityQuestion2;
  458.         return $this;
  459.     }
  460.     public function getSecurityAnswer2(): ?string
  461.     {
  462.         return $this->securityAnswer2;
  463.     }
  464.     public function setSecurityAnswer2(?string $securityAnswer2): self
  465.     {
  466.         $this->securityAnswer2 $securityAnswer2;
  467.         return $this;
  468.     }
  469.     /**
  470.      * @return mixed
  471.      */
  472.     public function getNewSecurityAnswer2()
  473.     {
  474.         return $this->newSecurityAnswer2;
  475.     }
  476.     /**
  477.      * @param mixed $newSecurityAnswer2
  478.      */
  479.     public function setNewSecurityAnswer2($newSecurityAnswer2): void
  480.     {
  481.         $this->newSecurityAnswer2 $newSecurityAnswer2;
  482.     }
  483.     public function getEmailAlternative(): ?string
  484.     {
  485.         return $this->emailAlternative;
  486.     }
  487.     public function setEmailAlternative(?string $emailAlternative): self
  488.     {
  489.         $this->emailAlternative strtolower($emailAlternative);
  490.         return $this;
  491.     }
  492.     public function getLastIp(): ?string
  493.     {
  494.         return $this->lastIp;
  495.     }
  496.     public function setLastIp(?string $lastIp): self
  497.     {
  498.         $this->lastIp $lastIp;
  499.         return $this;
  500.     }
  501.     public function getLastGeoCity(): ?string
  502.     {
  503.         return $this->lastGeoCity;
  504.     }
  505.     public function setLastGeoCity(?string $lastGeoCity): self
  506.     {
  507.         $this->lastGeoCity $lastGeoCity;
  508.         return $this;
  509.     }
  510.     public function getLastGeoCountry(): ?Country
  511.     {
  512.         return $this->lastGeoCountry;
  513.     }
  514.     public function setLastGeoCountry(?string $lastGeoCountry): self
  515.     {
  516.         $this->lastGeoCountry $lastGeoCountry;
  517.         return $this;
  518.     }
  519.     public function getLastLoginOn(): ?\DateTimeInterface
  520.     {
  521.         return $this->lastLoginOn;
  522.     }
  523.     public function setLastLoginOn(?\DateTimeInterface $lastLoginOn): self
  524.     {
  525.         $this->lastLoginOn $lastLoginOn;
  526.         return $this;
  527.     }
  528.     public function getDeletedOn(): ?\DateTimeInterface
  529.     {
  530.         return $this->deletedOn;
  531.     }
  532.     public function setDeletedOn(?\DateTimeInterface $deletedOn): self
  533.     {
  534.         $this->deletedOn $deletedOn;
  535.         return $this;
  536.     }
  537.     public function getFailedLoginCount(): ?int
  538.     {
  539.         return $this->failedLoginCount;
  540.     }
  541.     public function setFailedLoginCount(?int $failedLoginCount): self
  542.     {
  543.         $this->failedLoginCount $failedLoginCount;
  544.         return $this;
  545.     }
  546.     public function getLastSecurityType(): ?string
  547.     {
  548.         return $this->lastSecurityType;
  549.     }
  550.     public function setLastSecurityType(?string $lastSecurityType): self
  551.     {
  552.         $this->lastSecurityType $lastSecurityType;
  553.         return $this;
  554.     }
  555.     public function getSalutation(): ?string
  556.     {
  557.         return $this->salutation;
  558.     }
  559.     public function setSalutation(?string $salutation): self
  560.     {
  561.         $this->salutation $salutation;
  562.         return $this;
  563.     }
  564.     public function getTitle(): ?string
  565.     {
  566.         return $this->title;
  567.     }
  568.     public function setTitle(?string $title): self
  569.     {
  570.         $this->title $title;
  571.         return $this;
  572.     }
  573.     public function getFirstName(): ?string
  574.     {
  575.         return $this->firstName;
  576.     }
  577.     public function setFirstName(string $firstName): self
  578.     {
  579.         $this->firstName $firstName;
  580.         return $this;
  581.     }
  582.     public function getLastName(): ?string
  583.     {
  584.         return $this->lastName;
  585.     }
  586.     public function setLastName(string $lastName): self
  587.     {
  588.         $this->lastName $lastName;
  589.         return $this;
  590.     }
  591.     public function getFullName() {
  592.         return $this->firstName ' ' $this->lastName;
  593.     }
  594.     /**
  595.      * @return string
  596.      */
  597.     public function getNewPassword(): ?string
  598.     {
  599.         return $this->newPassword;
  600.     }
  601.     /**
  602.      * @param string $newPassword
  603.      */
  604.     public function setNewPassword(?string $newPassword): void
  605.     {
  606.         $this->newPassword $newPassword;
  607.     }
  608.     public function getEmailConfirmationCode(): ?string
  609.     {
  610.         return $this->emailConfirmationCode;
  611.     }
  612.     public function setEmailConfirmationCode(?string $emailConfirmationCode): self
  613.     {
  614.         $this->emailConfirmationCode $emailConfirmationCode;
  615.         return $this;
  616.     }
  617.     public function getEmailConfirmationExpiryOn(): ?\DateTimeInterface
  618.     {
  619.         return $this->emailConfirmationExpiryOn;
  620.     }
  621.     public function setEmailConfirmationExpiryOn(?\DateTimeInterface $emailConfirmationExpiryOn): self
  622.     {
  623.         $this->emailConfirmationExpiryOn $emailConfirmationExpiryOn;
  624.         return $this;
  625.     }
  626.     /**
  627.      * @return mixed
  628.      */
  629.     public function getIsEmailConfirmed()
  630.     {
  631.         return $this->isEmailConfirmed ?? false;
  632.     }
  633.     /**
  634.      * @param mixed $isEmailConfirmed
  635.      */
  636.     public function setIsEmailConfirmed($isEmailConfirmed): void
  637.     {
  638.         $this->isEmailConfirmed $isEmailConfirmed;
  639.     }
  640.     public function prepareEmailConfirmation() {
  641.         $this->setIsEmailConfirmed(false);
  642.         $this->emailConfirmationCode Helper::generateString();
  643.         $datNow = new \DateTime();
  644.         $datNow->add(new \DateInterval('P1D'));
  645.         $this->emailConfirmationExpiryOn $datNow;
  646.     }
  647.     public function getRecoverPasswordCode(): ?string
  648.     {
  649.         return $this->recoverPasswordCode;
  650.     }
  651.     public function setRecoverPasswordCode(?string $recoverPasswordCode): self
  652.     {
  653.         $this->recoverPasswordCode $recoverPasswordCode;
  654.         return $this;
  655.     }
  656.     public function getRecoverPasswordCodeExpiryOn(): ?\DateTimeInterface
  657.     {
  658.         return $this->recoverPasswordCodeExpiryOn;
  659.     }
  660.     public function setRecoverPasswordCodeExpiryOn(?\DateTimeInterface $recoverPasswordCodeExpiryOn): self
  661.     {
  662.         $this->recoverPasswordCodeExpiryOn $recoverPasswordCodeExpiryOn;
  663.         return $this;
  664.     }
  665.     public function getOtp(): ?string
  666.     {
  667.         return $this->otp;
  668.     }
  669.     public function setOtp(?string $otp): self
  670.     {
  671.         $this->otp $otp;
  672.         return $this;
  673.     }
  674.     public function getOtpNew(): ?string
  675.     {
  676.         return $this->otpNew;
  677.     }
  678.     public function setOtpNew(?string $otpNew): self
  679.     {
  680.         $this->otpNew $otpNew;
  681.         return $this;
  682.     }
  683.     /**
  684.      * @return mixed
  685.      */
  686.     public function getEmailResendRequestCode()
  687.     {
  688.         return $this->emailResendRequestCode;
  689.     }
  690.     /**
  691.      * @param mixed $emailResendRequestCode
  692.      */
  693.     public function setEmailResendRequestCode($emailResendRequestCode): void
  694.     {
  695.         $this->emailResendRequestCode $emailResendRequestCode;
  696.     }
  697.     /**
  698.      * @return \DateTime|null
  699.      */
  700.     public function getEmailResendRequestCodeExpiryOn(): ?\DateTime
  701.     {
  702.         return $this->emailResendRequestCodeExpiryOn;
  703.     }
  704.     /**
  705.      * @param \DateTime|null $emailResendRequestCodeExpiryOn
  706.      */
  707.     public function setEmailResendRequestCodeExpiryOn(?\DateTime $emailResendRequestCodeExpiryOn): void
  708.     {
  709.         $this->emailResendRequestCodeExpiryOn $emailResendRequestCodeExpiryOn;
  710.     }
  711.     public function getMaidenName(): ?string
  712.     {
  713.         return $this->maidenName;
  714.     }
  715.     public function setMaidenName(?string $maidenName): self
  716.     {
  717.         $this->maidenName $maidenName;
  718.         return $this;
  719.     }
  720.     public function getGender(): ?string
  721.     {
  722.         return $this->gender;
  723.     }
  724.     public function setGender(?string $gender): self
  725.     {
  726.         $this->gender $gender;
  727.         return $this;
  728.     }
  729.     public function toArray() {
  730.         return [
  731.             'id' => $this->id,
  732.             'salutation' => $this->salutation,
  733.             'title' => $this->title,
  734.             'firstName' => $this->firstName,
  735.             'lastName' => $this->lastName,
  736.             'maidenName' => $this->maidenName,
  737.             'email' => $this->email,
  738.             'mobile' => $this->mobile,
  739.             'emailAlternative' => $this->emailAlternative,
  740.             'securityQuestion1' => $this->securityQuestion1,
  741.             'securityQuestion2' => $this->securityQuestion2,
  742.             'gender' => $this->gender,
  743.             'birthDate' => $this->birthDate,
  744.             'birthCountryId' => $this->birthCountryId,
  745.             'birthPlace' => $this->birthPlace,
  746.             'nationalityId' => $this->nationalityId,
  747.             'formerNationalityId'=> $this->nationalityFormerId,
  748.             'additionalNationalityId' => $this->nationalityAdditionalId,
  749.             'locale' => $this->locale,
  750.             'additionalLocale' => $this->localeAdditional
  751.         ];
  752.     }
  753.     public function getBirthDate(): ?\DateTimeInterface
  754.     {
  755.         return $this->birthDate;
  756.     }
  757.     public function setBirthDate(?\DateTimeInterface $birthDate): self
  758.     {
  759.         $this->birthDate $birthDate;
  760.         return $this;
  761.     }
  762.     public function getBirthCountry(): ?Country
  763.     {
  764.         return $this->birthCountry;
  765.     }
  766.     public function setBirthCountry(?Country $birthCountry): self
  767.     {
  768.         $this->birthCountry $birthCountry;
  769.         return $this;
  770.     }
  771.     public function getBirthPlace(): ?string
  772.     {
  773.         return $this->birthPlace;
  774.     }
  775.     public function setBirthPlace(?string $birthPlace): self
  776.     {
  777.         $this->birthPlace $birthPlace;
  778.         return $this;
  779.     }
  780.     public function getNationality(): ?Country
  781.     {
  782.         return $this->nationality;
  783.     }
  784.     public function setNationality(?Country $nationality): self
  785.     {
  786.         $this->nationality $nationality;
  787.         return $this;
  788.     }
  789.     public function getNationalityFormer(): ?Country
  790.     {
  791.         return $this->nationalityFormer;
  792.     }
  793.     public function setNationalityFormer(?Country $nationalityFormer): self
  794.     {
  795.         $this->nationalityFormer $nationalityFormer;
  796.         return $this;
  797.     }
  798.     public function getNationalityAdditional(): ?Country
  799.     {
  800.         return $this->nationalityAdditional;
  801.     }
  802.     public function setNationalityAdditional(?Country $nationalityAdditional): self
  803.     {
  804.         $this->nationalityAdditional $nationalityAdditional;
  805.         return $this;
  806.     }
  807.     public function getLocaleAdditional(): ?string
  808.     {
  809.         return $this->localeAdditional;
  810.     }
  811.     public function setLocaleAdditional(?string $localeAdditional): self
  812.     {
  813.         $this->localeAdditional $localeAdditional;
  814.         return $this;
  815.     }
  816.     public function getUserIdentifier(): string
  817.     {
  818.         return $this->email;
  819.     }
  820. }