diff --git a/src/Repository/UserRepository.php b/src/Repository/UserRepository.php index 06c01a0..752422d 100644 --- a/src/Repository/UserRepository.php +++ b/src/Repository/UserRepository.php @@ -37,9 +37,9 @@ class UserRepository extends ServiceEntityRepository implements PasswordUpgrader public function getCaseManagers(Company $company): array { return $this->createQueryBuilder('u') - ->andWhere('u.job != :job') + ->andWhere('u.caseManager = :case_manager') ->andWhere('u.company = :company') - ->setParameter('job', 'CASE_WORKER') + ->setParameter('case_manager', true) ->setParameter('company', $company->getId()->toBinary()) ->getQuery() ->getResult() @@ -49,9 +49,9 @@ class UserRepository extends ServiceEntityRepository implements PasswordUpgrader public function getTherapists(Company $company): array { return $this->createQueryBuilder('u') - ->andWhere('u.job = :job') + ->andWhere('u.therapist = :therapist') ->andWhere('u.company = :company') - ->setParameter('job', 'THERAPIST') + ->setParameter('therapist', true) ->setParameter('company', $company->getId()->toBinary()) ->getQuery() ->getResult() @@ -61,9 +61,9 @@ class UserRepository extends ServiceEntityRepository implements PasswordUpgrader public function getAdmins(Company $company): array { return $this->createQueryBuilder('u') - ->andWhere('u.job = :job') + ->andWhere('u.su = :su') ->andWhere('u.company = :company') - ->setParameter('job', 'ADMIN') + ->setParameter('su', true) ->setParameter('company', $company->getId()->toBinary()) ->getQuery() ->getResult()