fix bug user
This commit is contained in:
+5
-1
@@ -9,9 +9,12 @@ use Doctrine\DBAL\Types\Types;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface;
|
||||
use Symfony\Component\Security\Core\User\UserInterface;
|
||||
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
|
||||
use Symfony\Component\Validator\Constraints as Assert;
|
||||
|
||||
#[ORM\Entity(repositoryClass: UserRepository::class)]
|
||||
#[ORM\Table(name: '`user`')]
|
||||
#[ORM\Entity(repositoryClass: UserRepository::class)]
|
||||
#[UniqueEntity(fields: ['email'], message: 'There is already an account with this email.')]
|
||||
class User implements UserInterface, PasswordAuthenticatedUserInterface
|
||||
{
|
||||
#[ORM\Id]
|
||||
@@ -20,6 +23,7 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface
|
||||
private ?int $id = null;
|
||||
|
||||
#[ORM\Column(length: 180, unique: true)]
|
||||
#[Assert\Email]
|
||||
private ?string $email = null;
|
||||
|
||||
#[ORM\Column]
|
||||
|
||||
Reference in New Issue
Block a user