fix: filter selectable services by participant's age
This commit is contained in:
@@ -79,4 +79,10 @@ class Service
|
||||
|
||||
#[Groups(['api:single', 'api:list'])]
|
||||
public ?string $direction = null;
|
||||
|
||||
#[Groups(['api:single', 'api:list'])]
|
||||
public ?int $ageFrom = null;
|
||||
|
||||
#[Groups(['api:single', 'api:list'])]
|
||||
public ?int $ageTo = null;
|
||||
}
|
||||
|
||||
@@ -203,6 +203,8 @@ class TravelLoader extends AbstractLoader
|
||||
$service->price = $this
|
||||
->stringToFloat($this->getStringOrNullValue($serviceNode->filterXPath('//preis')));
|
||||
$service->status = $this->getStringOrNullValue($serviceNode->filterXPath('//status'));
|
||||
$service->ageFrom = $this->getIntOrNullValue($serviceNode->filterXPath('//altervon'));
|
||||
$service->ageTo = $this->getIntOrNullValue($serviceNode->filterXPath('//alterbis'));
|
||||
|
||||
$additionalServices[$serviceId] = $service;
|
||||
});
|
||||
|
||||
@@ -34,6 +34,9 @@ class ServicesParser extends AbstractParser
|
||||
$service->direction = $node->attr('richtung');
|
||||
}
|
||||
|
||||
$service->ageFrom = $this->getIntOrNullValue($node->filterXPath('//altervon'));
|
||||
$service->ageTo = $this->getIntOrNullValue($node->filterXPath('//alterbis'));
|
||||
|
||||
$services[$service->id] = $service;
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user