<?php
namespace App\Entity;
use App\Repository\UserRepository;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface;
use Symfony\Component\Security\Core\User\UserInterface;
use Symfony\Component\PasswordHasher\Hasher\UserPasswordHasherInterface;
/**
* @ORM\Entity(repositoryClass=UserRepository::class)
* @ORM\Table(name="`user`")
*/
class User implements UserInterface, PasswordAuthenticatedUserInterface
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=180, unique=true)
*/
private $email;
/**
* @ORM\Column(type="json")
*/
private $roles = [];
/**
* @var string The hashed password
* @ORM\Column(type="string")
*/
private $password;
/**
* @ORM\Column(type="string", length=255)
*/
private $gender;
/**
* @ORM\Column(type="date")
*/
private $birthday;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $birthplace;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $homeTown;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $maritalStatus;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $nation;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $religion;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $identification;
/**
* @ORM\Column(type="date", nullable=true)
*/
private $daysForIdentity;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $placeOfIssue;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $resident;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $currentAddress;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $literacy;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $status;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $jobPosition;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $workplaces;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $bankAccount;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $nameOfAccount;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $bankOfIssue;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $personalTaxCode;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $hourlyRate;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $phone;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $facebook;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $linkedin;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $skype;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $defaultLanguage;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $emailSignature;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $otherInformation;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $fullName;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $profileImage;
/**
* @ORM\Column(type="string", length=255)
*/
private $staffCode;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $document;
public function __toString(): string
{
return $this->email;
}
public function getId(): ?int
{
return $this->id;
}
public function getEmail(): ?string
{
return $this->email;
}
public function setEmail(string $email): self
{
$this->email = $email;
return $this;
}
/**
* A visual identifier that represents this user.
*
* @see UserInterface
*/
public function getUserIdentifier(): string
{
return (string) $this->email;
}
/**
* @deprecated since Symfony 5.3, use getUserIdentifier instead
*/
public function getUsername(): string
{
return (string) $this->email;
}
/**
* @see UserInterface
*/
public function getRoles(): array
{
$roles = $this->roles;
// guarantee every user at least has ROLE_USER
$roles[] = 'ROLE_USER';
return array_unique($roles);
}
public function setRoles(array $roles): self
{
$this->roles = $roles;
return $this;
}
/**
* @see PasswordAuthenticatedUserInterface
*/
public function getPassword(): string
{
return $this->password;
}
public function setPassword(string $password = null): self
{
if($password)
{
$this->password = $password;
}
return $this;
}
/**
* Returning a salt is only needed, if you are not using a modern
* hashing algorithm (e.g. bcrypt or sodium) in your security.yaml.
*
* @see UserInterface
*/
public function getSalt(): ?string
{
return null;
}
/**
* @see UserInterface
*/
public function eraseCredentials()
{
// If you store any temporary, sensitive data on the user, clear it here
// $this->plainPassword = null;
}
public function getGender(): ?string
{
return $this->gender;
}
public function setGender(string $gender): self
{
$this->gender = $gender;
return $this;
}
public function getBirthday(): ?\DateTimeInterface
{
return $this->birthday;
}
public function setBirthday(\DateTimeInterface $birthday): self
{
$this->birthday = $birthday;
return $this;
}
public function getBirthplace(): ?string
{
return $this->birthplace;
}
public function setBirthplace(?string $birthplace): self
{
$this->birthplace = $birthplace;
return $this;
}
public function getHomeTown(): ?string
{
return $this->homeTown;
}
public function setHomeTown(?string $homeTown): self
{
$this->homeTown = $homeTown;
return $this;
}
public function getMaritalStatus(): ?string
{
return $this->maritalStatus;
}
public function setMaritalStatus(?string $maritalStatus): self
{
$this->maritalStatus = $maritalStatus;
return $this;
}
public function getNation(): ?string
{
return $this->nation;
}
public function setNation(?string $nation): self
{
$this->nation = $nation;
return $this;
}
public function getReligion(): ?string
{
return $this->religion;
}
public function setReligion(?string $religion): self
{
$this->religion = $religion;
return $this;
}
public function getIdentification(): ?string
{
return $this->identification;
}
public function setIdentification(?string $identification): self
{
$this->identification = $identification;
return $this;
}
public function getDaysForIdentity(): ?\DateTimeInterface
{
return $this->daysForIdentity;
}
public function setDaysForIdentity(?\DateTimeInterface $daysForIdentity): self
{
$this->daysForIdentity = $daysForIdentity;
return $this;
}
public function getPlaceOfIssue(): ?string
{
return $this->placeOfIssue;
}
public function setPlaceOfIssue(?string $placeOfIssue): self
{
$this->placeOfIssue = $placeOfIssue;
return $this;
}
public function getResident(): ?string
{
return $this->resident;
}
public function setResident(?string $resident): self
{
$this->resident = $resident;
return $this;
}
public function getCurrentAddress(): ?string
{
return $this->currentAddress;
}
public function setCurrentAddress(?string $currentAddress): self
{
$this->currentAddress = $currentAddress;
return $this;
}
public function getLiteracy(): ?string
{
return $this->literacy;
}
public function setLiteracy(?string $literacy): self
{
$this->literacy = $literacy;
return $this;
}
public function getStatus(): ?string
{
return $this->status;
}
public function setStatus(?string $status): self
{
$this->status = $status;
return $this;
}
public function getJobPosition(): ?string
{
return $this->jobPosition;
}
public function setJobPosition(?string $jobPosition): self
{
$this->jobPosition = $jobPosition;
return $this;
}
public function getWorkplaces(): ?string
{
return $this->workplaces;
}
public function setWorkplaces(?string $workplaces): self
{
$this->workplaces = $workplaces;
return $this;
}
public function getBankAccount(): ?string
{
return $this->bankAccount;
}
public function setBankAccount(?string $bankAccount): self
{
$this->bankAccount = $bankAccount;
return $this;
}
public function getNameOfAccount(): ?string
{
return $this->nameOfAccount;
}
public function setNameOfAccount(?string $nameOfAccount): self
{
$this->nameOfAccount = $nameOfAccount;
return $this;
}
public function getBankOfIssue(): ?string
{
return $this->bankOfIssue;
}
public function setBankOfIssue(?string $bankOfIssue): self
{
$this->bankOfIssue = $bankOfIssue;
return $this;
}
public function getPersonalTaxCode(): ?string
{
return $this->personalTaxCode;
}
public function setPersonalTaxCode(?string $personalTaxCode): self
{
$this->personalTaxCode = $personalTaxCode;
return $this;
}
public function getHourlyRate(): ?int
{
return $this->hourlyRate;
}
public function setHourlyRate(?int $hourlyRate): self
{
$this->hourlyRate = $hourlyRate;
return $this;
}
public function getPhone(): ?string
{
return $this->phone;
}
public function setPhone(?string $phone): self
{
$this->phone = $phone;
return $this;
}
public function getFacebook(): ?string
{
return $this->facebook;
}
public function setFacebook(?string $facebook): self
{
$this->facebook = $facebook;
return $this;
}
public function getLinkedin(): ?string
{
return $this->linkedin;
}
public function setLinkedin(?string $linkedin): self
{
$this->linkedin = $linkedin;
return $this;
}
public function getSkype(): ?string
{
return $this->skype;
}
public function setSkype(?string $skype): self
{
$this->skype = $skype;
return $this;
}
public function getDefaultLanguage(): ?string
{
return $this->defaultLanguage;
}
public function setDefaultLanguage(?string $defaultLanguage): self
{
$this->defaultLanguage = $defaultLanguage;
return $this;
}
public function getEmailSignature(): ?string
{
return $this->emailSignature;
}
public function setEmailSignature(?string $emailSignature): self
{
$this->emailSignature = $emailSignature;
return $this;
}
public function getOtherInformation(): ?string
{
return $this->otherInformation;
}
public function setOtherInformation(?string $otherInformation): self
{
$this->otherInformation = $otherInformation;
return $this;
}
public function getFullName(): ?string
{
return $this->fullName;
}
public function setFullName(?string $fullName): self
{
$this->fullName = $fullName;
return $this;
}
public function getProfileImage(): ?string
{
return $this->profileImage;
}
public function setProfileImage(?string $profileImage): self
{
$this->profileImage = $profileImage;
return $this;
}
public function getStaffCode(): ?string
{
return $this->staffCode;
}
public function setStaffCode(string $staffCode): self
{
$this->staffCode = $staffCode;
return $this;
}
public function getDocument(): ?string
{
return $this->document;
}
public function setDocument(?string $document): self
{
$this->document = $document;
return $this;
}
}