diff --git a/src/Repository/UserRepository.php b/src/Repository/UserRepository.php index 752422d..f46643c 100644 --- a/src/Repository/UserRepository.php +++ b/src/Repository/UserRepository.php @@ -81,6 +81,19 @@ class UserRepository extends ServiceEntityRepository implements PasswordUpgrader ; } + public function getCaseWorkers(): array + { + return $this->createQueryBuilder('u') + ->orWhere('u.caseWorker = :case_worker') + ->orWhere('u.caseManager = :case_manager') + ->setParameter('case_worker', true) + ->setParameter('case_manager', true) + ->orderBy('u.name', 'ASC') + ->getQuery() + ->getResult() + ; + } + // /** // * @return User[] Returns an array of User objects // */