Skip to content

Commit fb71531

Browse files
committed
Fix #5: Set country via 'additionalData'
1 parent f75dd9d commit fb71531

File tree

1 file changed

+16
-0
lines changed
  • src/YawikXingVendorApi/Filter/XingData

1 file changed

+16
-0
lines changed

src/YawikXingVendorApi/Filter/XingData/City.php

+16
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,22 @@ public function filter($value)
3636
$logger = $value->getLogger();
3737
$job = $value->getJob();
3838

39+
if (isset($data['xingLocation'])) {
40+
$xingData->setCity($data['xingLocation']['city']);
41+
$xingData->setTags($data['xingLocation']['city'], 'prepend');
42+
$logger && $logger->info('----> Set City via "xingLocation": ' . $data['xingLocation']['city']);
43+
if (isset($data['xingLocation']['postcode'])) {
44+
$xingData->setZipcode($data['xingLocation']['postcode']);
45+
$logger && $logger->info('----> Set ZipCode via "xingLocation": ' . $data['xingLocation']['postcode']);
46+
}
47+
if (isset($data['xingLocation']['country_code'])) {
48+
$xingData->setCountry($data['xingLocation']['country_code']);
49+
$logger && $logger->info('----> Set Country via "xingLocation": ' . $data['xingLocation']['country_code']);
50+
}
51+
52+
return true;
53+
}
54+
3955
if (isset($data['xingCity'])) {
4056
$xingData->setCity($data['xingCity']);
4157

0 commit comments

Comments
 (0)