feat: load hotel data locally for sidebar

This commit is contained in:
Björn Fromme
2026-01-07 18:35:09 +01:00
parent 97be776b10
commit b0b608f12e
4 changed files with 101 additions and 29 deletions
+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;
}
}