feat: filter teamers by multiple job profiles

This commit is contained in:
Björn Fromme
2024-07-18 15:09:56 +02:00
parent ebf89d19c3
commit b563bf3059
5 changed files with 19 additions and 16 deletions
+7 -5
View File
@@ -63,13 +63,13 @@ class TeamerFilterHandler
->setNoTrainings($data['no_trainings'])
;
if (0 < (int) $data['job_profile']) {
$jobProfile = $this
if (0 < count($data['job_profiles'])) {
$jobProfiles = $this
->entityManager
->getRepository(JobProfile::class)
->find($data['job_profile'])
->findBy(['id' => $data['job_profiles']])
;
$filterDto->setJobProfile($jobProfile);
$filterDto->setJobProfiles($jobProfiles);
}
return $filterDto;
@@ -84,8 +84,10 @@ class TeamerFilterHandler
'pickup_id' => $filterDto->getPickupId(),
'ski_license' => $filterDto->hasSkiLicense(),
'snowboard_license' => $filterDto->hasSnowboardLicense(),
'job_profile' => $filterDto->getJobProfile()?->getId(),
'no_trainings' => $filterDto->hasNoTrainings(),
'job_profiles' => array_map(function (JobProfile $jobProfile) {
return $jobProfile->getId();
}, $filterDto->getJobProfiles()),
]);
}