feat: multiselect field for filtering
This commit is contained in:
@@ -59,16 +59,16 @@ class AssignmentFilterHandler
|
||||
if (isset($data['date_to'])) {
|
||||
$filterDto->setDateTo($data['date_to']);
|
||||
}
|
||||
if (isset($data['job_profile']) && 0 < (int) $data['job_profile']) {
|
||||
$jobProfile = $this
|
||||
if (isset($data['job_profiles']) && 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);
|
||||
}
|
||||
if (isset($data['hotel'])) {
|
||||
$filterDto->setHotel($data['hotel']);
|
||||
if (isset($data['hotels']) && 0 < count($data['hotels'])) {
|
||||
$filterDto->setHotels($data['hotels']);
|
||||
}
|
||||
if (isset($data['duration']) && 0 < (int) $data['duration']) {
|
||||
$filterDto->setDuration($data['duration']);
|
||||
@@ -88,8 +88,10 @@ class AssignmentFilterHandler
|
||||
$this->getSession()->set($this->namespace, [
|
||||
'date_from' => $filterDto->getDateFrom(),
|
||||
'date_to' => $filterDto->getDateTo(),
|
||||
'job_profile' => $filterDto->getJobProfile()?->getId(),
|
||||
'hotel' => $filterDto->getHotel(),
|
||||
'job_profiles' => array_map(function (JobProfile $jobProfile) {
|
||||
return $jobProfile->getId();
|
||||
}, $filterDto->getJobProfiles()),
|
||||
'hotels' => $filterDto->getHotels(),
|
||||
'duration' => $filterDto->getDuration(),
|
||||
'status' => $filterDto->getStatus(),
|
||||
'include_past' => $filterDto->isIncludePast(),
|
||||
|
||||
Reference in New Issue
Block a user