Fix and Enhancements

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

No files matched your search

+19
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) {