prevent email or username from being non-unique (#2730)

This commit is contained in:
Kevin Papst
2021-08-25 15:18:46 +02:00
committed by GitHub
parent f743503705
commit 5023fa6189
7 changed files with 67 additions and 22 deletions

View File

@@ -82,6 +82,11 @@ class UserRepository extends EntityRepository implements UserLoaderInterface
return parent::findOneBy($criteria, $orderBy);
}
public function findByUsername($username): ?User
{
return parent::findOneBy(['username' => $username]);
}
public function countUser(?bool $enabled = null): int
{
if (null !== $enabled) {