Remove unused alternative names of cummunities to prevent warnings
This commit is contained in:
+14
-3
@@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user