Updated repository

This commit is contained in:
Ryan Prather 2024-12-03 00:00:34 -05:00
parent bbfce2b424
commit 24877f51af

View File

@ -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()