Advertisement
Guest User

Untitled

a guest
Jan 13th, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.97 KB | None | 0 0
  1. <?php
  2.  
  3. namespace App\Entity;
  4.  
  5. use Doctrine\ORM\Mapping as ORM;
  6. use Symfony\Component\Validator\Constraints as Assert;
  7. use Symfony\Component\Security\Core\User\UserInterface;
  8. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  9.  
  10. /**
  11. * @ORM\Entity(repositoryClass="App\Repository\UserRepository")
  12. * @UniqueEntity
  13. * (
  14. * fields = {"email"},
  15. * message = "L'email que vous avez indiquer est deja utiliser"
  16. * )
  17. */
  18. class User implements UserInterface
  19. {
  20. /**
  21. * @ORM\Id()
  22. * @ORM\GeneratedValue()
  23. * @ORM\Column(type="integer")
  24. */
  25. private $id;
  26.  
  27. /**
  28. * @ORM\Column(type="string", length=255)
  29. * *Assert\Email()
  30. */
  31. private $email;
  32.  
  33. /**
  34. * @ORM\Column(type="string", length=255)
  35. */
  36. private $username;
  37.  
  38. /**
  39. * @ORM\Column(type="string", length=255)
  40. * @Assert\Length(min="6", minMessage="6 caracteres minimum")
  41. */
  42. private $password;
  43. /**
  44. * @Assert\EqualTo(propertyPath="password", message="Vous n'avez pas tapez le meme mot de passe")
  45. */
  46. public $confirm_password;
  47.  
  48. public function getId(): ?int
  49. {
  50. return $this->id;
  51. }
  52.  
  53. public function getEmail(): ?string
  54. {
  55. return $this->email;
  56. }
  57.  
  58. public function setEmail(string $email): self
  59. {
  60. $this->email = $email;
  61.  
  62. return $this;
  63. }
  64.  
  65. public function getUsername(): ?string
  66. {
  67. return $this->username;
  68. }
  69.  
  70. public function setUsername(string $username): self
  71. {
  72. $this->username = $username;
  73.  
  74. return $this;
  75. }
  76.  
  77. public function getPassword(): ?string
  78. {
  79. return $this->password;
  80. }
  81.  
  82. public function setPassword(string $password): self
  83. {
  84. $this->password = $password;
  85.  
  86. return $this;
  87. }
  88.  
  89. public function eraseCredentials() {}
  90. public function getSalt() {}
  91. public function getRoles() {
  92. return ['ROLE_USER'];
  93. }
  94. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement