feat: load hotel data locally for sidebar

This commit is contained in:
Björn Fromme committed 2026-03-16 12:02:27 +01:00
1 parent 5a47ca6053
commit d6f2681c61
4 files changed
+101 -29

No files matched your search

+6 -1
View File
@@ -36,12 +36,17 @@ class HotelLoader extends AbstractLoader
}
public function mapCodeToId(string $hotelCode, ?string $filename = 'hotel.xml'): ?int
{
return $this->loadByCode($hotelCode, $filename)?->id;
}
public function loadByCode(string $hotelCode, ?string $filename = 'hotel.xml'): ?Hotel
{
$hotels = $this->loadAll($filename);
foreach ($hotels as $hotel) {
if ($hotelCode === $hotel->code) {
return $hotel->id;
return $hotel;
}
}