Remove unused alternative names of cummunities to prevent warnings
This commit is contained in:
parent
65fb0f9dce
commit
5f01b21c58
17
zefixAPI.php
17
zefixAPI.php
|
|
@ -107,15 +107,26 @@ function sendAPICommunityRequest(string $username, string $password): string|boo
|
||||||
return $response;
|
return $response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function communityCSV(string $username, string $password): string {
|
function communityCSV(string $username, string $password): string {
|
||||||
$response = sendAPICommunityRequest($username, $password);
|
$response = sendAPICommunityRequest($username, $password);
|
||||||
$communityArray = json_decode($response, true);
|
$communityArray = json_decode($response, true);
|
||||||
$csvOutput = 'id,bfsId,Kanton,Gemeindename,registryOfCommerceId,replacedById,alternateNames\n';
|
|
||||||
// Create CSV rows
|
$csvOutput = "id,bfsId,Kanton,Gemeindename,registryOfCommerceId,replacedById\n";
|
||||||
|
|
||||||
foreach ($communityArray as $item) {
|
foreach ($communityArray as $item) {
|
||||||
$csvOutput .= implode(',', $item) . "\n";
|
$row = [
|
||||||
|
$item['id'] ?? '',
|
||||||
|
$item['bfsId'] ?? '',
|
||||||
|
$item['canton'] ?? '',
|
||||||
|
$item['name'] ?? '',
|
||||||
|
$item['registryOfficeId'] ?? '',
|
||||||
|
$item['replacedById'] ?? ''
|
||||||
|
];
|
||||||
|
|
||||||
|
$csvOutput .= implode(',', $row) . "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
return $csvOutput;
|
return $csvOutput;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue