<?php
namespace App\Entity;
use App\Repository\CandidatRepository;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Security\Core\User\UserInterface;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
/**
* @ORM\Entity(repositoryClass=CandidatRepository::class)
*/
class Candidat implements UserInterface
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255, unique=true)
*/
private $email;
/**
* @ORM\Column(type="string", length=255)
*/
private $password;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $nom;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $prenom;
/**
* @ORM\Column(type="boolean")
*/
private $isVerified = false;
/**
* @ORM\Column(type="string", length=6, nullable=true)
*/
private $verificationCode;
/**
* @ORM\Column(type="datetime_immutable", nullable=true)
*/
private $createdAt;
/**
* @ORM\Column(type="string", length=6, nullable=true)
*/
private $loginCode;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $loginCodeExpiresAt;
/**
* @ORM\Column(type="date", nullable=true)
*/
private $dateNaissance;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $fileCv;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $post;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $lieu;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $ville;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $adresse;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $telephone;
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;
}
public function getPassword(): ?string
{
return $this->password;
}
public function setPassword(string $password): self
{
$this->password = $password;
return $this;
}
public function getNom(): ?string
{
return $this->nom;
}
public function setNom(string $nom): self
{
$this->nom = $nom;
return $this;
}
public function getPrenom(): ?string
{
return $this->prenom;
}
public function setPrenom(string $prenom): self
{
$this->prenom = $prenom;
return $this;
}
public function isVerified(): ?bool
{
return $this->isVerified;
}
public function setIsVerified(bool $isVerified): self
{
$this->isVerified = $isVerified;
return $this;
}
public function getVerificationCode(): ?string
{
return $this->verificationCode;
}
public function setVerificationCode(?string $verificationCode): self
{
$this->verificationCode = $verificationCode;
return $this;
}
public function getCreatedAt(): ?\DateTimeImmutable
{
return $this->createdAt;
}
public function setCreatedAt(\DateTimeImmutable $createdAt): self
{
$this->createdAt = $createdAt;
return $this;
}
public function getLoginCode(): ?string
{
return $this->loginCode;
}
public function setLoginCode(?string $loginCode): self
{
$this->loginCode = $loginCode;
return $this;
}
public function getLoginCodeExpiresAt(): ?\DateTimeInterface
{
return $this->loginCodeExpiresAt;
}
public function setLoginCodeExpiresAt(?\DateTimeInterface $loginCodeExpiresAt): self
{
$this->loginCodeExpiresAt = $loginCodeExpiresAt;
return $this;
}
// === Méthodes requises par UserInterface ===
public function getUsername(): string
{
return (string) $this->email;
}
public function getUserIdentifier(): string
{
return (string) $this->email;
}
public function getRoles(): array
{
// Tu peux adapter ici les rôles selon tes besoins
return ['ROLE_USER'];
}
public function eraseCredentials()
{
// Si tu as des données temporaires sensibles, les effacer ici
}
public function getSalt(): ?string
{
// Non utilisé avec les algorithmes modernes comme bcrypt ou argon2i
return null;
}
public function getDateNaissance(): ?\DateTimeInterface
{
return $this->dateNaissance;
}
public function setDateNaissance(\DateTimeInterface $dateNaissance): self
{
$this->dateNaissance = $dateNaissance;
return $this;
}
public function getFileCv(): ?string
{
return $this->fileCv;
}
public function setFileCv(string $fileCv): self
{
$this->fileCv = $fileCv;
return $this;
}
public function getPost(): ?string
{
return $this->post;
}
public function setPost(string $post): self
{
$this->post = $post;
return $this;
}
public function getLieu(): ?string
{
return $this->lieu;
}
public function setLieu(string $lieu): self
{
$this->lieu = $lieu;
return $this;
}
public function getVille(): ?string
{
return $this->ville;
}
public function setVille(string $ville): self
{
$this->ville = $ville;
return $this;
}
public function getAdresse(): ?string
{
return $this->adresse;
}
public function setAdresse(string $adresse): self
{
$this->adresse = $adresse;
return $this;
}
public function getTelephone(): ?int
{
return $this->telephone;
}
public function setTelephone(int $telephone): self
{
$this->telephone = $telephone;
return $this;
}
}