src/Entity/User.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\UserRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface;
  6. use Symfony\Component\Security\Core\User\UserInterface;
  7. use Symfony\Component\PasswordHasher\Hasher\UserPasswordHasherInterface;
  8. /**
  9.  * @ORM\Entity(repositoryClass=UserRepository::class)
  10.  * @ORM\Table(name="`user`")
  11.  */
  12. class User implements UserInterfacePasswordAuthenticatedUserInterface
  13. {
  14.     /**
  15.      * @ORM\Id
  16.      * @ORM\GeneratedValue
  17.      * @ORM\Column(type="integer")
  18.      */
  19.     private $id;
  20.     /**
  21.      * @ORM\Column(type="string", length=180, unique=true)
  22.      */
  23.     private $email;
  24.     /**
  25.      * @ORM\Column(type="json")
  26.      */
  27.     private $roles = [];
  28.     /**
  29.      * @var string The hashed password
  30.      * @ORM\Column(type="string")
  31.      */
  32.     private $password;
  33.     /**
  34.      * @ORM\Column(type="string", length=255)
  35.      */
  36.     private $gender;
  37.     /**
  38.      * @ORM\Column(type="date")
  39.      */
  40.     private $birthday;
  41.     /**
  42.      * @ORM\Column(type="string", length=255, nullable=true)
  43.      */
  44.     private $birthplace;
  45.     /**
  46.      * @ORM\Column(type="string", length=255, nullable=true)
  47.      */
  48.     private $homeTown;
  49.     /**
  50.      * @ORM\Column(type="string", length=255, nullable=true)
  51.      */
  52.     private $maritalStatus;
  53.     /**
  54.      * @ORM\Column(type="string", length=255, nullable=true)
  55.      */
  56.     private $nation;
  57.     /**
  58.      * @ORM\Column(type="string", length=255, nullable=true)
  59.      */
  60.     private $religion;
  61.     /**
  62.      * @ORM\Column(type="string", length=255, nullable=true)
  63.      */
  64.     private $identification;
  65.     /**
  66.      * @ORM\Column(type="date", nullable=true)
  67.      */
  68.     private $daysForIdentity;
  69.     /**
  70.      * @ORM\Column(type="string", length=255, nullable=true)
  71.      */
  72.     private $placeOfIssue;
  73.     /**
  74.      * @ORM\Column(type="string", length=255, nullable=true)
  75.      */
  76.     private $resident;
  77.     /**
  78.      * @ORM\Column(type="string", length=255, nullable=true)
  79.      */
  80.     private $currentAddress;
  81.     /**
  82.      * @ORM\Column(type="string", length=255, nullable=true)
  83.      */
  84.     private $literacy;
  85.     /**
  86.      * @ORM\Column(type="string", length=255, nullable=true)
  87.      */
  88.     private $status;
  89.     /**
  90.      * @ORM\Column(type="string", length=255, nullable=true)
  91.      */
  92.     private $jobPosition;
  93.     /**
  94.      * @ORM\Column(type="string", length=255, nullable=true)
  95.      */
  96.     private $workplaces;
  97.     /**
  98.      * @ORM\Column(type="string", length=255, nullable=true)
  99.      */
  100.     private $bankAccount;
  101.     /**
  102.      * @ORM\Column(type="string", length=255, nullable=true)
  103.      */
  104.     private $nameOfAccount;
  105.     /**
  106.      * @ORM\Column(type="string", length=255, nullable=true)
  107.      */
  108.     private $bankOfIssue;
  109.     /**
  110.      * @ORM\Column(type="string", length=255, nullable=true)
  111.      */
  112.     private $personalTaxCode;
  113.     /**
  114.      * @ORM\Column(type="integer", nullable=true)
  115.      */
  116.     private $hourlyRate;
  117.     /**
  118.      * @ORM\Column(type="string", length=255, nullable=true)
  119.      */
  120.     private $phone;
  121.     /**
  122.      * @ORM\Column(type="string", length=255, nullable=true)
  123.      */
  124.     private $facebook;
  125.     /**
  126.      * @ORM\Column(type="string", length=255, nullable=true)
  127.      */
  128.     private $linkedin;
  129.     /**
  130.      * @ORM\Column(type="string", length=255, nullable=true)
  131.      */
  132.     private $skype;
  133.     /**
  134.      * @ORM\Column(type="string", length=255, nullable=true)
  135.      */
  136.     private $defaultLanguage;
  137.     /**
  138.      * @ORM\Column(type="string", length=255, nullable=true)
  139.      */
  140.     private $emailSignature;
  141.     /**
  142.      * @ORM\Column(type="text", nullable=true)
  143.      */
  144.     private $otherInformation;
  145.     /**
  146.      * @ORM\Column(type="string", length=255, nullable=true)
  147.      */
  148.     private $fullName;
  149.     /**
  150.      * @ORM\Column(type="string", length=255, nullable=true)
  151.      */
  152.     private $profileImage;
  153.     /**
  154.      * @ORM\Column(type="string", length=255)
  155.      */
  156.     private $staffCode;
  157.     /**
  158.      * @ORM\Column(type="text", nullable=true)
  159.      */
  160.     private $document;
  161.     public function __toString(): string
  162.     {
  163.         return $this->email;
  164.     }
  165.     public function getId(): ?int
  166.     {
  167.         return $this->id;
  168.     }
  169.     public function getEmail(): ?string
  170.     {
  171.         return $this->email;
  172.     }
  173.     public function setEmail(string $email): self
  174.     {
  175.         $this->email $email;
  176.         return $this;
  177.     }
  178.     /**
  179.      * A visual identifier that represents this user.
  180.      *
  181.      * @see UserInterface
  182.      */
  183.     public function getUserIdentifier(): string
  184.     {
  185.         return (string) $this->email;
  186.     }
  187.     /**
  188.      * @deprecated since Symfony 5.3, use getUserIdentifier instead
  189.      */
  190.     public function getUsername(): string
  191.     {
  192.         return (string) $this->email;
  193.     }
  194.     /**
  195.      * @see UserInterface
  196.      */
  197.     public function getRoles(): array
  198.     {
  199.         $roles $this->roles;
  200.         // guarantee every user at least has ROLE_USER
  201.         $roles[] = 'ROLE_USER';
  202.         return array_unique($roles);
  203.     }
  204.     public function setRoles(array $roles): self
  205.     {
  206.         $this->roles $roles;
  207.         return $this;
  208.     }
  209.     /**
  210.      * @see PasswordAuthenticatedUserInterface
  211.      */
  212.     public function getPassword(): string
  213.     {
  214.         return $this->password;
  215.     }
  216.     public function setPassword(string $password null): self
  217.     {
  218.         if($password)
  219.         {
  220.             $this->password $password;
  221.         }
  222.         return $this;
  223.     }
  224.     /**
  225.      * Returning a salt is only needed, if you are not using a modern
  226.      * hashing algorithm (e.g. bcrypt or sodium) in your security.yaml.
  227.      *
  228.      * @see UserInterface
  229.      */
  230.     public function getSalt(): ?string
  231.     {
  232.         return null;
  233.     }
  234.     /**
  235.      * @see UserInterface
  236.      */
  237.     public function eraseCredentials()
  238.     {
  239.         // If you store any temporary, sensitive data on the user, clear it here
  240.         // $this->plainPassword = null;
  241.     }
  242.     public function getGender(): ?string
  243.     {
  244.         return $this->gender;
  245.     }
  246.     public function setGender(string $gender): self
  247.     {
  248.         $this->gender $gender;
  249.         return $this;
  250.     }
  251.     public function getBirthday(): ?\DateTimeInterface
  252.     {
  253.         return $this->birthday;
  254.     }
  255.     public function setBirthday(\DateTimeInterface $birthday): self
  256.     {
  257.         $this->birthday $birthday;
  258.         return $this;
  259.     }
  260.     public function getBirthplace(): ?string
  261.     {
  262.         return $this->birthplace;
  263.     }
  264.     public function setBirthplace(?string $birthplace): self
  265.     {
  266.         $this->birthplace $birthplace;
  267.         return $this;
  268.     }
  269.     public function getHomeTown(): ?string
  270.     {
  271.         return $this->homeTown;
  272.     }
  273.     public function setHomeTown(?string $homeTown): self
  274.     {
  275.         $this->homeTown $homeTown;
  276.         return $this;
  277.     }
  278.     public function getMaritalStatus(): ?string
  279.     {
  280.         return $this->maritalStatus;
  281.     }
  282.     public function setMaritalStatus(?string $maritalStatus): self
  283.     {
  284.         $this->maritalStatus $maritalStatus;
  285.         return $this;
  286.     }
  287.     public function getNation(): ?string
  288.     {
  289.         return $this->nation;
  290.     }
  291.     public function setNation(?string $nation): self
  292.     {
  293.         $this->nation $nation;
  294.         return $this;
  295.     }
  296.     public function getReligion(): ?string
  297.     {
  298.         return $this->religion;
  299.     }
  300.     public function setReligion(?string $religion): self
  301.     {
  302.         $this->religion $religion;
  303.         return $this;
  304.     }
  305.     public function getIdentification(): ?string
  306.     {
  307.         return $this->identification;
  308.     }
  309.     public function setIdentification(?string $identification): self
  310.     {
  311.         $this->identification $identification;
  312.         return $this;
  313.     }
  314.     public function getDaysForIdentity(): ?\DateTimeInterface
  315.     {
  316.         return $this->daysForIdentity;
  317.     }
  318.     public function setDaysForIdentity(?\DateTimeInterface $daysForIdentity): self
  319.     {
  320.         $this->daysForIdentity $daysForIdentity;
  321.         return $this;
  322.     }
  323.     public function getPlaceOfIssue(): ?string
  324.     {
  325.         return $this->placeOfIssue;
  326.     }
  327.     public function setPlaceOfIssue(?string $placeOfIssue): self
  328.     {
  329.         $this->placeOfIssue $placeOfIssue;
  330.         return $this;
  331.     }
  332.     public function getResident(): ?string
  333.     {
  334.         return $this->resident;
  335.     }
  336.     public function setResident(?string $resident): self
  337.     {
  338.         $this->resident $resident;
  339.         return $this;
  340.     }
  341.     public function getCurrentAddress(): ?string
  342.     {
  343.         return $this->currentAddress;
  344.     }
  345.     public function setCurrentAddress(?string $currentAddress): self
  346.     {
  347.         $this->currentAddress $currentAddress;
  348.         return $this;
  349.     }
  350.     public function getLiteracy(): ?string
  351.     {
  352.         return $this->literacy;
  353.     }
  354.     public function setLiteracy(?string $literacy): self
  355.     {
  356.         $this->literacy $literacy;
  357.         return $this;
  358.     }
  359.     public function getStatus(): ?string
  360.     {
  361.         return $this->status;
  362.     }
  363.     public function setStatus(?string $status): self
  364.     {
  365.         $this->status $status;
  366.         return $this;
  367.     }
  368.     public function getJobPosition(): ?string
  369.     {
  370.         return $this->jobPosition;
  371.     }
  372.     public function setJobPosition(?string $jobPosition): self
  373.     {
  374.         $this->jobPosition $jobPosition;
  375.         return $this;
  376.     }
  377.     public function getWorkplaces(): ?string
  378.     {
  379.         return $this->workplaces;
  380.     }
  381.     public function setWorkplaces(?string $workplaces): self
  382.     {
  383.         $this->workplaces $workplaces;
  384.         return $this;
  385.     }
  386.     public function getBankAccount(): ?string
  387.     {
  388.         return $this->bankAccount;
  389.     }
  390.     public function setBankAccount(?string $bankAccount): self
  391.     {
  392.         $this->bankAccount $bankAccount;
  393.         return $this;
  394.     }
  395.     public function getNameOfAccount(): ?string
  396.     {
  397.         return $this->nameOfAccount;
  398.     }
  399.     public function setNameOfAccount(?string $nameOfAccount): self
  400.     {
  401.         $this->nameOfAccount $nameOfAccount;
  402.         return $this;
  403.     }
  404.     public function getBankOfIssue(): ?string
  405.     {
  406.         return $this->bankOfIssue;
  407.     }
  408.     public function setBankOfIssue(?string $bankOfIssue): self
  409.     {
  410.         $this->bankOfIssue $bankOfIssue;
  411.         return $this;
  412.     }
  413.     public function getPersonalTaxCode(): ?string
  414.     {
  415.         return $this->personalTaxCode;
  416.     }
  417.     public function setPersonalTaxCode(?string $personalTaxCode): self
  418.     {
  419.         $this->personalTaxCode $personalTaxCode;
  420.         return $this;
  421.     }
  422.     public function getHourlyRate(): ?int
  423.     {
  424.         return $this->hourlyRate;
  425.     }
  426.     public function setHourlyRate(?int $hourlyRate): self
  427.     {
  428.         $this->hourlyRate $hourlyRate;
  429.         return $this;
  430.     }
  431.     public function getPhone(): ?string
  432.     {
  433.         return $this->phone;
  434.     }
  435.     public function setPhone(?string $phone): self
  436.     {
  437.         $this->phone $phone;
  438.         return $this;
  439.     }
  440.     public function getFacebook(): ?string
  441.     {
  442.         return $this->facebook;
  443.     }
  444.     public function setFacebook(?string $facebook): self
  445.     {
  446.         $this->facebook $facebook;
  447.         return $this;
  448.     }
  449.     public function getLinkedin(): ?string
  450.     {
  451.         return $this->linkedin;
  452.     }
  453.     public function setLinkedin(?string $linkedin): self
  454.     {
  455.         $this->linkedin $linkedin;
  456.         return $this;
  457.     }
  458.     public function getSkype(): ?string
  459.     {
  460.         return $this->skype;
  461.     }
  462.     public function setSkype(?string $skype): self
  463.     {
  464.         $this->skype $skype;
  465.         return $this;
  466.     }
  467.     public function getDefaultLanguage(): ?string
  468.     {
  469.         return $this->defaultLanguage;
  470.     }
  471.     public function setDefaultLanguage(?string $defaultLanguage): self
  472.     {
  473.         $this->defaultLanguage $defaultLanguage;
  474.         return $this;
  475.     }
  476.     public function getEmailSignature(): ?string
  477.     {
  478.         return $this->emailSignature;
  479.     }
  480.     public function setEmailSignature(?string $emailSignature): self
  481.     {
  482.         $this->emailSignature $emailSignature;
  483.         return $this;
  484.     }
  485.     public function getOtherInformation(): ?string
  486.     {
  487.         return $this->otherInformation;
  488.     }
  489.     public function setOtherInformation(?string $otherInformation): self
  490.     {
  491.         $this->otherInformation $otherInformation;
  492.         return $this;
  493.     }
  494.     public function getFullName(): ?string
  495.     {
  496.         return $this->fullName;
  497.     }
  498.     public function setFullName(?string $fullName): self
  499.     {
  500.         $this->fullName $fullName;
  501.         return $this;
  502.     }
  503.     public function getProfileImage(): ?string
  504.     {
  505.         return $this->profileImage;
  506.     }
  507.     public function setProfileImage(?string $profileImage): self
  508.     {
  509.         $this->profileImage $profileImage;
  510.         return $this;
  511.     }
  512.     public function getStaffCode(): ?string
  513.     {
  514.         return $this->staffCode;
  515.     }
  516.     public function setStaffCode(string $staffCode): self
  517.     {
  518.         $this->staffCode $staffCode;
  519.         return $this;
  520.     }
  521.     public function getDocument(): ?string
  522.     {
  523.         return $this->document;
  524.     }
  525.     public function setDocument(?string $document): self
  526.     {
  527.         $this->document $document;
  528.         return $this;
  529.     }
  530. }