chg: dev: refactor all forms to have Symfony Form Types & Validation Constrainsts - & implement Google ReCapthca v3 #4
This commit is contained in:
@@ -18,9 +18,9 @@ use Doctrine\ORM\Mapping\Entity;
|
||||
use Doctrine\ORM\Mapping\GeneratedValue;
|
||||
use Doctrine\ORM\Mapping\Id;
|
||||
use Doctrine\ORM\Mapping\Table;
|
||||
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;
|
||||
|
||||
/**
|
||||
* Class User
|
||||
@@ -34,6 +34,8 @@ use Symfony\Component\Validator\Constraints as Assert;
|
||||
*/
|
||||
#[Table(name: 'app_user')]
|
||||
#[Entity(repositoryClass: UserRepository::class)]
|
||||
#[UniqueEntity(fields: ['username'], message: 'This username is already taken.')]
|
||||
#[UniqueEntity(fields: ['email'], message: 'This email address is already registered.')]
|
||||
class User implements UserInterface, PasswordAuthenticatedUserInterface
|
||||
{
|
||||
#[Id, GeneratedValue, Column]
|
||||
@@ -82,7 +84,7 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface
|
||||
|
||||
public function getUserIdentifier(): string
|
||||
{
|
||||
return (string) $this->username;
|
||||
return (string)$this->username;
|
||||
}
|
||||
|
||||
public function getRoles(): array
|
||||
|
||||
Reference in New Issue
Block a user