src/Entity/Candidat.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\CandidatRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Symfony\Component\Security\Core\User\UserInterface;
  6. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  7. /**
  8.  * @ORM\Entity(repositoryClass=CandidatRepository::class)
  9.  */
  10. class Candidat implements UserInterface
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\Column(type="string", length=255, unique=true)
  20.      */
  21.     private $email;
  22.     /**
  23.      * @ORM\Column(type="string", length=255)
  24.      */
  25.     private $password;
  26.     /**
  27.      * @ORM\Column(type="string", length=255, nullable=true)
  28.      */
  29.     private $nom;
  30.     /**
  31.      * @ORM\Column(type="string", length=255, nullable=true)
  32.      */
  33.     private $prenom;
  34.     /**
  35.      * @ORM\Column(type="boolean")
  36.      */
  37.     private $isVerified false;
  38.     /**
  39.      * @ORM\Column(type="string", length=6, nullable=true)
  40.      */
  41.     private $verificationCode;
  42.     /**
  43.      * @ORM\Column(type="datetime_immutable", nullable=true)
  44.      */
  45.     private $createdAt;
  46.     /**
  47.      * @ORM\Column(type="string", length=6, nullable=true)
  48.      */
  49.     private $loginCode;
  50.     /**
  51.      * @ORM\Column(type="datetime", nullable=true)
  52.      */
  53.     private $loginCodeExpiresAt;
  54.     /**
  55.      * @ORM\Column(type="date", nullable=true)
  56.      */
  57.     private $dateNaissance;
  58.     /**
  59.      * @ORM\Column(type="string", length=255, nullable=true)
  60.      */
  61.     private $fileCv;
  62.     /**
  63.      * @ORM\Column(type="string", length=255, nullable=true)
  64.      */
  65.     private $post;
  66.     /**
  67.      * @ORM\Column(type="string", length=255, nullable=true)
  68.      */
  69.     private $lieu;
  70.     /**
  71.      * @ORM\Column(type="string", length=255, nullable=true)
  72.      */
  73.     private $ville;
  74.     /**
  75.      * @ORM\Column(type="string", length=255, nullable=true)
  76.      */
  77.     private $adresse;
  78.     /**
  79.      * @ORM\Column(type="string", length=255, nullable=true)
  80.      */
  81.     private $telephone;
  82.     public function getId(): ?int
  83.     {
  84.         return $this->id;
  85.     }
  86.     public function getEmail(): ?string
  87.     {
  88.         return $this->email;
  89.     }
  90.     public function setEmail(string $email): self
  91.     {
  92.         $this->email $email;
  93.         return $this;
  94.     }
  95.     public function getPassword(): ?string
  96.     {
  97.         return $this->password;
  98.     }
  99.     public function setPassword(string $password): self
  100.     {
  101.         $this->password $password;
  102.         return $this;
  103.     }
  104.     public function getNom(): ?string
  105.     {
  106.         return $this->nom;
  107.     }
  108.     public function setNom(string $nom): self
  109.     {
  110.         $this->nom $nom;
  111.         return $this;
  112.     }
  113.     public function getPrenom(): ?string
  114.     {
  115.         return $this->prenom;
  116.     }
  117.     public function setPrenom(string $prenom): self
  118.     {
  119.         $this->prenom $prenom;
  120.         return $this;
  121.     }
  122.     public function isVerified(): ?bool
  123.     {
  124.         return $this->isVerified;
  125.     }
  126.     public function setIsVerified(bool $isVerified): self
  127.     {
  128.         $this->isVerified $isVerified;
  129.         return $this;
  130.     }
  131.     public function getVerificationCode(): ?string
  132.     {
  133.         return $this->verificationCode;
  134.     }
  135.     public function setVerificationCode(?string $verificationCode): self
  136.     {
  137.         $this->verificationCode $verificationCode;
  138.         return $this;
  139.     }
  140.     public function getCreatedAt(): ?\DateTimeImmutable
  141.     {
  142.         return $this->createdAt;
  143.     }
  144.     public function setCreatedAt(\DateTimeImmutable $createdAt): self
  145.     {
  146.         $this->createdAt $createdAt;
  147.         return $this;
  148.     }
  149.     public function getLoginCode(): ?string
  150.     {
  151.         return $this->loginCode;
  152.     }
  153.     public function setLoginCode(?string $loginCode): self
  154.     {
  155.         $this->loginCode $loginCode;
  156.         return $this;
  157.     }
  158.     public function getLoginCodeExpiresAt(): ?\DateTimeInterface
  159.     {
  160.         return $this->loginCodeExpiresAt;
  161.     }
  162.     public function setLoginCodeExpiresAt(?\DateTimeInterface $loginCodeExpiresAt): self
  163.     {
  164.         $this->loginCodeExpiresAt $loginCodeExpiresAt;
  165.         return $this;
  166.     }
  167.     // === Méthodes requises par UserInterface ===
  168.     public function getUsername(): string
  169.     {
  170.         return (string) $this->email;
  171.     }
  172.     public function getUserIdentifier(): string
  173.     {
  174.         return (string) $this->email;
  175.     }
  176.     public function getRoles(): array
  177.     {
  178.         // Tu peux adapter ici les rôles selon tes besoins
  179.         return ['ROLE_USER'];
  180.     }
  181.     public function eraseCredentials()
  182.     {
  183.         // Si tu as des données temporaires sensibles, les effacer ici
  184.     }
  185.     public function getSalt(): ?string
  186.     {
  187.         // Non utilisé avec les algorithmes modernes comme bcrypt ou argon2i
  188.         return null;
  189.     }
  190.     public function getDateNaissance(): ?\DateTimeInterface
  191.     {
  192.         return $this->dateNaissance;
  193.     }
  194.     public function setDateNaissance(\DateTimeInterface $dateNaissance): self
  195.     {
  196.         $this->dateNaissance $dateNaissance;
  197.         return $this;
  198.     }
  199.     public function getFileCv(): ?string
  200.     {
  201.         return $this->fileCv;
  202.     }
  203.     public function setFileCv(string $fileCv): self
  204.     {
  205.         $this->fileCv $fileCv;
  206.         return $this;
  207.     }
  208.     public function getPost(): ?string
  209.     {
  210.         return $this->post;
  211.     }
  212.     public function setPost(string $post): self
  213.     {
  214.         $this->post $post;
  215.         return $this;
  216.     }
  217.     public function getLieu(): ?string
  218.     {
  219.         return $this->lieu;
  220.     }
  221.     public function setLieu(string $lieu): self
  222.     {
  223.         $this->lieu $lieu;
  224.         return $this;
  225.     }
  226.     public function getVille(): ?string
  227.     {
  228.         return $this->ville;
  229.     }
  230.     public function setVille(string $ville): self
  231.     {
  232.         $this->ville $ville;
  233.         return $this;
  234.     }
  235.     public function getAdresse(): ?string
  236.     {
  237.         return $this->adresse;
  238.     }
  239.     public function setAdresse(string $adresse): self
  240.     {
  241.         $this->adresse $adresse;
  242.         return $this;
  243.     }
  244.     public function getTelephone(): ?int
  245.     {
  246.         return $this->telephone;
  247.     }
  248.     public function setTelephone(int $telephone): self
  249.     {
  250.         $this->telephone $telephone;
  251.         return $this;
  252.     }
  253. }