feat: filter teamers by multiple job profiles
This commit is contained in:
@@ -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()),
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user