Fix and Enhancements

This commit is contained in:
Xbird
2022-04-26 19:17:57 +00:00
parent 200c6ac256
commit 72123b8782
22 changed files with 173 additions and 143 deletions

View File

@@ -79,6 +79,25 @@ class UserRepository extends ServiceEntityRepository implements PasswordUpgrader
return $this;
}
public function onlyRole(string $role)
{
$this->qb->andWhere('u.roles LIKE :role')
->setParameter('role', '%ROLE_' . strtoupper($role) . '%');
return $this;
}
public function onlyActive()
{
$this->qb->andWhere('u.isDesactivated = 0');
return $this;
}
public function onlyDesactivated()
{
$this->qb->andWhere('u.isDesactivated = 1');
return $this;
}
public function search(?string $search, bool $adminmode = false)
{
if (null === $search) {