feat: filter assignments by hotel in favor of destination
This commit is contained in:
@@ -66,16 +66,16 @@ class AssignmentFilterType extends AbstractType
|
||||
])
|
||||
;
|
||||
}
|
||||
if (0 < count($options['destinations'])) {
|
||||
if (0 < count($options['hotels'])) {
|
||||
$choices = [];
|
||||
foreach ($options['hotels'] as $item) {
|
||||
$choices[$item->getHotel()] = $item->getHotelCode();
|
||||
}
|
||||
$builder
|
||||
->add('destination', EntityType::class, [
|
||||
'label' => 'Destination',
|
||||
'class' => Destination::class,
|
||||
->add('hotel', ChoiceType::class, [
|
||||
'label' => 'Haus',
|
||||
'required' => false,
|
||||
'choice_label' => function (Destination $destination) {
|
||||
return $destination->getProduct();
|
||||
},
|
||||
'choices' => $options['destinations'],
|
||||
'choices' => $choices,
|
||||
])
|
||||
;
|
||||
}
|
||||
@@ -89,7 +89,7 @@ class AssignmentFilterType extends AbstractType
|
||||
'min_date' => null,
|
||||
'max_date' => null,
|
||||
'job_profiles' => [],
|
||||
'destinations' => [],
|
||||
'hotels' => [],
|
||||
])
|
||||
->setAllowedTypes('min_date', [\DateTimeImmutable::class, 'null'])
|
||||
->setAllowedTypes('max_date', [\DateTimeImmutable::class, 'null'])
|
||||
|
||||
Reference in New Issue
Block a user