This commit is contained in:
ALLAVENA--VALETTE Romain 2024-10-10 14:47:52 +02:00 committed by bourgoino
parent 562b343063
commit ea5be39a2e

View File

@ -4,14 +4,12 @@ namespace App\Entity;
use App\Repository\UserRepository; use App\Repository\UserRepository;
use Doctrine\ORM\Mapping as ORM; 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\PasswordAuthenticatedUserInterface;
use Symfony\Component\Security\Core\User\UserInterface; use Symfony\Component\Security\Core\User\UserInterface;
#[ORM\Entity(repositoryClass: UserRepository::class)] #[ORM\Entity(repositoryClass: UserRepository::class)]
#[ORM\Table(name: 'userApp')] #[ORM\Table(name: '`user`')]
#[ORM\UniqueConstraint(name: 'UNIQ_IDENTIFIER_NICKNAME', fields: ['nickname'])] #[ORM\UniqueConstraint(name: 'UNIQ_IDENTIFIER_NICKNAME', fields: ['nickname'])]
#[UniqueEntity(fields: ['nickname'], message: 'Il y a déjà un utilisateur à ce nom')]
class User implements UserInterface, PasswordAuthenticatedUserInterface class User implements UserInterface, PasswordAuthenticatedUserInterface
{ {
#[ORM\Id] #[ORM\Id]
@ -47,7 +45,7 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface
private ?string $address = null; private ?string $address = null;
#[ORM\Column(length: 255)] #[ORM\Column(length: 255)]
private ?string $email = null; private ?string $mail = null;
public function getId(): ?int public function getId(): ?int
{ {
@ -172,15 +170,17 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface
return $this; return $this;
} }
public function getEmail(): ?string public function getMail(): ?string
{ {
return $this->email; return $this->mail;
} }
public function setEmail(string $email): static public function setMail(string $mail): static
{ {
$this->email = $email; $this->mail = $mail;
return $this; return $this;
} }
} }