From 0bdc6c873ba97c88ddb370eefb0be431cdd85145 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Fromme?= Date: Thu, 20 Aug 2026 14:43:09 +0200 Subject: [PATCH] feat: explicit icon label map for accommodation booking api --- .../Classes/Middleware/ApiMiddleware.php | 50 +++++++++++++++---- 1 file changed, 40 insertions(+), 10 deletions(-) diff --git a/public/typo3conf/ext/ep_products/Classes/Middleware/ApiMiddleware.php b/public/typo3conf/ext/ep_products/Classes/Middleware/ApiMiddleware.php index 967c909e..82e55372 100644 --- a/public/typo3conf/ext/ep_products/Classes/Middleware/ApiMiddleware.php +++ b/public/typo3conf/ext/ep_products/Classes/Middleware/ApiMiddleware.php @@ -221,34 +221,64 @@ class ApiMiddleware implements MiddlewareInterface $icons = []; if (($hotel['beds_count'] ?? 0) > 0) { - $icons['bed'] = sprintf('%d Betten', $hotel['beds_count']); + $icons[] = [ + 'icon' => 'bed', + 'label' => sprintf('%d Betten', $hotel['beds_count']), + ]; } if (($hotel['parking_count'] ?? 0) > 0) { - $icons['parking'] = sprintf('%d Parkplätze', $hotel['parking_count']); + $icons[] = [ + 'icon' => 'parking', + 'label' => sprintf('%d Parkplätze', $hotel['parking_count']), + ]; } if ($hotel['altitude'] ?? null) { - $icons['mountain'] = $hotel['altitude']; + $icons[] = [ + 'icon' => 'mountain', + 'label' => $hotel['altitude'], + ]; } if ($hotel['distance_bus'] ?? null) { - $icons['bus'] = $hotel['distance_bus']; + $icons[] = [ + 'icon' => 'bus', + 'label' => $hotel['distance_bus'], + ]; } if ($hotel['distance_lift'] ?? null) { - $icons['lift'] = $hotel['distance_lift']; + $icons[] = [ + 'icon' => 'lift', + 'label' => $hotel['distance_lift'], + ]; } if ($hotel['shower'] ?? null) { - $icons['shower'] = $hotel['shower']; + $icons[] = [ + 'icon' => 'shower', + 'label' => $hotel['shower'], + ]; } if ($hotel['partyroom'] ?? false) { - $icons['party'] = 'Partyzimmer'; + $icons[] = [ + 'icon' => 'party', + 'label' => 'Partyzimmer', + ]; } if ($hotel['gamesroom'] ?? false) { - $icons['dice'] = 'Spielezimmer'; + $icons[] = [ + 'icon' => 'dice', + 'label' => 'Spielezimmer', + ]; } if ($hotel['sauna'] ?? false) { - $icons['sauna'] = 'Sauna'; + $icons[] = [ + 'icon' => 'sauna', + 'label' => 'Sauna', + ]; } if ($hotel['wifi'] ?? false) { - $icons['wifi'] = 'WiFi'; + $icons[] = [ + 'icon' => 'wifi', + 'label' => 'WiFi', + ]; } return [