feat(notification) : add NotificationService and UserRepository::findByRole
This commit is contained in:
@@ -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()
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user