Preserve sorting of services on import
This commit is contained in:
@@ -372,7 +372,7 @@ class DateImportService implements SingletonInterface
|
|||||||
$servicesBoard = $this->parseSelectionGroup($xmlDate, 'Leistungen Verpflegung');
|
$servicesBoard = $this->parseSelectionGroup($xmlDate, 'Leistungen Verpflegung');
|
||||||
$servicesIncluded = $this->parseSelectionGroup($xmlDate, 'Leistungen Sonstige');
|
$servicesIncluded = $this->parseSelectionGroup($xmlDate, 'Leistungen Sonstige');
|
||||||
|
|
||||||
$date['services_included'] = serialize($this->combineServices($skiPass, $servicesBoard, $servicesIncluded));
|
$date['services_included'] = serialize($this->combineServices($servicesIncluded, $skiPass, $servicesBoard));
|
||||||
|
|
||||||
if ($servicesBoard) {
|
if ($servicesBoard) {
|
||||||
$date['board'] = reset($servicesBoard);
|
$date['board'] = reset($servicesBoard);
|
||||||
@@ -678,13 +678,15 @@ class DateImportService implements SingletonInterface
|
|||||||
$data[$type] = [];
|
$data[$type] = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
$data[$type][] = [
|
$data[$type][(int)$service->attributes()['id']] = [
|
||||||
'idBusPro' => (int) $service->attributes()['idbuspro'],
|
'idBusPro' => (int) $service->attributes()['idbuspro'],
|
||||||
'label' => $label,
|
'label' => $label,
|
||||||
'price' => number_format($price, 2, ',', '.'),
|
'price' => number_format($price, 2, ',', '.'),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ksort($data);
|
||||||
|
|
||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -700,10 +702,12 @@ class DateImportService implements SingletonInterface
|
|||||||
foreach ($selectionGroup as $selection)
|
foreach ($selectionGroup as $selection)
|
||||||
{
|
{
|
||||||
$attributes = $selection->attributes();
|
$attributes = $selection->attributes();
|
||||||
$idBusPro = (int) $attributes['idbuspro'];
|
$id = (int) $attributes['id'];
|
||||||
$data[$idBusPro] = (string) $attributes['bezeichnung'];
|
$data[$id] = (string) $attributes['bezeichnung'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ksort($data);
|
||||||
|
|
||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user