Buckets:
| namespace App\Entity; | |
| use App\Repository\UserRepository; | |
| use Doctrine\ORM\Mapping as ORM; | |
| use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity; | |
| use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface; | |
| use Symfony\Component\Security\Core\User\UserInterface; | |
| use Symfony\Component\Validator\Constraints as Assert; | |
| #[ORM\Entity(repositoryClass: UserRepository::class)] | |
| #[ORM\UniqueConstraint(name: 'UNIQ_IDENTIFIER_EMAIL', fields: ['email'])] | |
| (fields: ['email'], message: 'There is already an account with this email') | |
| class User implements UserInterface, PasswordAuthenticatedUserInterface | |
| { | |
| #[ORM\Id] | |
| #[ORM\GeneratedValue] | |
| #[ORM\Column] | |
| private ?int $id = null; | |
| () | |
| () | |
| #[ORM\Column(length: 255, unique: true)] | |
| private ?string $email = null; | |
| #[ORM\Column(length: 180, nullable: true)] | |
| private ?string $username = null; | |
| /** | |
| * @var list<string> The user roles | |
| */ | |
| #[ORM\Column] | |
| private array $roles = []; | |
| /** | |
| * @var string The hashed password | |
| * La contrainte Regex valide que le mot de passe : | |
| * * contient au moins un chiffre | |
| * * contient au moins une lettre en minuscule | |
| * * contient au moins une lettre en majuscule | |
| * * contient au moins un caractère spécial qui n'est pas un espace | |
| * * fait entre 8 et 32 caractères de long | |
| */ | |
| () | |
| (minScore: Assert\PasswordStrength::STRENGTH_MEDIUM) | |
| ('/^(?=.*[0-9])(?=.*[a-z])(?=.*[A-Z])(?=.*\W)(?!.*\s).{8,32}$/') | |
| #[ORM\Column] | |
| private ?string $password = null; | |
| () | |
| #[ORM\Column(length: 255)] | |
| private ?string $firstname = null; | |
| () | |
| #[ORM\Column(length: 255)] | |
| private ?string $lastname = null; | |
| public function getId(): ?int | |
| { | |
| return $this->id; | |
| } | |
| public function getEmail(): ?string | |
| { | |
| return $this->email; | |
| } | |
| public function setEmail(string $email): static | |
| { | |
| $this->email = $email; | |
| return $this; | |
| } | |
| /** | |
| * A visual identifier that represents this user. | |
| * | |
| * @see UserInterface | |
| */ | |
| public function getUserIdentifier(): string | |
| { | |
| return (string) $this->email; | |
| } | |
| /** | |
| * @see UserInterface | |
| * | |
| * @return list<string> | |
| */ | |
| public function getRoles(): array | |
| { | |
| $roles = $this->roles; | |
| // guarantee every user at least has ROLE_USER | |
| $roles[] = 'ROLE_USER'; | |
| return array_unique($roles); | |
| } | |
| /** | |
| * @param list<string> $roles | |
| */ | |
| public function setRoles(array $roles): static | |
| { | |
| $this->roles = $roles; | |
| return $this; | |
| } | |
| /** | |
| * @see PasswordAuthenticatedUserInterface | |
| */ | |
| public function getPassword(): ?string | |
| { | |
| return $this->password; | |
| } | |
| public function setPassword(string $password): static | |
| { | |
| $this->password = $password; | |
| return $this; | |
| } | |
| /** | |
| * @see UserInterface | |
| */ | |
| public function eraseCredentials(): void | |
| { | |
| // If you store any temporary, sensitive data on the user, clear it here | |
| // $this->plainPassword = null; | |
| } | |
| public function getFirstname(): ?string | |
| { | |
| return $this->firstname; | |
| } | |
| public function setFirstname(string $firstname): static | |
| { | |
| $this->firstname = $firstname; | |
| return $this; | |
| } | |
| public function getLastname(): ?string | |
| { | |
| return $this->lastname; | |
| } | |
| public function setLastname(string $lastname): static | |
| { | |
| $this->lastname = $lastname; | |
| return $this; | |
| } | |
| public function getUsername(): ?string | |
| { | |
| return $this->username; | |
| } | |
| public function setUsername(string $username): static | |
| { | |
| $this->username = $username; | |
| return $this; | |
| } | |
| } | |
Xet Storage Details
- Size:
- 3.98 kB
- Xet hash:
- 3ff1865a1b6312ba4590f1af6165d6ffb26a469b5b848ebc534a6c9bf7b66919
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.