fix: skip travels whose hotel is missing from the master data

This commit is contained in:
fromme committed 2026-09-29 14:46:27 +02:00
1 parent 1845441bc2
commit 6b539f43f3
2 files changed
+72

No files matched your search

+7
View File
@@ -92,6 +92,13 @@ class TravelLoader extends AbstractLoader
->each(function (Crawler $hotelNode) use (&$mapping, $hotels, $travelId) {
$hotelId = (int) $hotelNode->attr('idbuspro');
// A travel may reference a hotel that hotel.xml does not carry.
// Reading ->name off the miss would fatal the whole mapping, not
// just this entry, and take /api/travels down with it.
if (false === isset($hotels[$hotelId])) {
return;
}
$mapping[$travelId]['hotels'][$hotelId] = [
'id' => $hotelId,
'code' => $hotelNode->attr('code'),