feat(notification) : add NotificationService and UserRepository::findByRole

This commit is contained in:
2026-03-15 19:46:37 +01:00
parent ce2eaa03e1
commit 4094048aba
2 changed files with 87 additions and 0 deletions

View File

@@ -17,4 +17,17 @@ class UserRepository extends ServiceEntityRepository
{
parent::__construct($registry, User::class);
}
/**
* @return User[]
*/
public function findByRole(string $role): array
{
return $this->createQueryBuilder('u')
->where('u.roles LIKE :role')
->setParameter('role', '%"'.$role.'"%')
->getQuery()
->getResult()
;
}
}