WIP Impelement more stuff

This commit is contained in:
Björn Fromme
2023-10-04 15:10:16 +02:00
parent dec8feedf2
commit cc1ab396af
35 changed files with 928 additions and 177 deletions
+2 -2
View File
@@ -32,8 +32,8 @@ class Countries
return $countries;
}
public function get(int $id): ?Country
public function get(string $token): ?Country
{
return $this->getAll()[$id] ?? null;
return $this->getAll()[$token] ?? null;
}
}
+3 -3
View File
@@ -176,15 +176,15 @@ class ResponseParser
$countries = [];
foreach ($xml->xpath('laender/land') as $item) {
$id = (int) $item->attributes()['id'];
$token = (string) $item->attributes()['kuerzel'];
$country = new Country();
$country
->setId($id)
->setId((int) $item->attributes()['id'])
->setName((string) $item->attributes()['bezeichnung'])
->setToken((string) $item->attributes()['kuerzel'])
->setNationality((string) $item->attributes()['nationalitaet'])
;
$countries[$id] = $country;
$countries[$token] = $country;
}
$response = new BaseDataResponse();