WIP Impelement more stuff
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user