diff --git a/src/Repository/AssignmentRepository.php b/src/Repository/AssignmentRepository.php index 9034bb7..09f914c 100644 --- a/src/Repository/AssignmentRepository.php +++ b/src/Repository/AssignmentRepository.php @@ -87,14 +87,10 @@ class AssignmentRepository extends ServiceEntityRepository ->setParameter('now', new \DateTimeImmutable()) ; - // exclude job profiles that require trainings for teamers that didn't attend any - if (0 === $teamer->getTrainingAttendances()->count()) { - $qb->andWhere($qb->expr()->isNull('required_training')); - } - - // exclude job profiles that require licenses for teamers that don't have any - if (0 === $teamer->getLicenses()->count()) { + // limit result for teamers not having any trainings AND licences + if (0 === $teamer->getTrainingAttendances()->count() && 0 === $teamer->getLicenses()->count()) { $qb + ->andWhere($qb->expr()->isNull('required_training')) ->andWhere($qb->expr()->eq('job_profile.requiredLicenses', ':requiredLicenses')) ->setParameter('requiredLicenses', '[]') ;