feat: sort pickups by their times

This commit is contained in:
Björn Fromme
2025-11-17 10:00:03 +01:00
parent 6e96f6fb44
commit 33c3dc6022
2 changed files with 27 additions and 9 deletions
+3 -2
View File
@@ -45,13 +45,14 @@ class TravelParser extends AbstractParser
$hotelNode = $this->getHotelNode($node, $hotelId);
$dateFrom = $this->stringToDate($node->attr('termin'));
$dateTo = $this->stringToDate($node->attr('bis'));
$travel = new Travel();
$travel->id = (int) $node->attr('idbuspro');
$travel->hotelId = (int) $hotelNode->attr('idbuspro');
$travel->label = $this->getStringOrNullValue($node->filterXPath('//text'));
$travel->dateFrom = $dateFrom;
$travel->dateTo = $this->stringToDate($node->attr('bis'));
$travel->dateTo = $dateTo;
$travel->code = $node->attr('code');
$travel->type = $node->attr('reiseart');
$travel->status = $this->getStringOrNullValue($node->filterXPath('//status_hin'));
@@ -63,7 +64,7 @@ class TravelParser extends AbstractParser
->getTransportationServices($node->filterXPath('//lei_befoerderung/leistung'));
$travel->rooms = $this->getRooms($hotelNode);
$travel->pickupsOutbound = $this->getPickups($node->filterXPath('//zustiege/zustieg'), $dateFrom);
$travel->pickupsInbound = $this->getPickups($node->filterXPath('//zustiege_rueck/zustieg_rueck'));
$travel->pickupsInbound = $this->getPickups($node->filterXPath('//zustiege_rueck/zustieg_rueck'), $dateTo);
$travel->guide = $this->getGuide($node);
return $travel;