Unverified Commit 0dcba00f authored by Sebastian Castro's avatar Sebastian Castro
Browse files

Use custom formatted address during import

parent 5e8d1675
......@@ -80,6 +80,7 @@ class ElementImportMappingService
else if ($address) {
if (array_key_exists('streetNumber', $address)) $data[$key]['streetNumber'] = $address['streetNumber'];
if (array_key_exists('streetAddress', $address)) $data[$key]['streetAddress'] = $address['streetAddress'];
if (array_key_exists('customFormatedAddress', $address)) $data[$key]['customFormatedAddress'] = $address['customFormatedAddress'];
if (array_key_exists('addressLocality', $address)) $data[$key]['addressLocality'] = $address['addressLocality'];
if (array_key_exists('postalCode', $address)) $data[$key]['postalCode'] = $address['postalCode'];
if (array_key_exists('addressCountry', $address)) $data[$key]['addressCountry'] = $address['addressCountry'];
......
......@@ -23,7 +23,7 @@ class ElementImportOneService
protected $optionIdsToAddToEachElement = [];
protected $coreFields = ['id', 'name', 'categories', 'streetAddress', 'addressLocality', 'postalCode', 'addressCountry', 'latitude', 'longitude', 'images', 'files', 'owner', 'source', 'openHours'];
protected $coreFields = ['id', 'name', 'categories', 'streetAddress', 'addressLocality', 'postalCode', 'addressCountry', 'customFormatedAddress', 'latitude', 'longitude', 'images', 'files', 'owner', 'source', 'openHours'];
protected $privateDataProps;
/**
......@@ -121,7 +121,7 @@ class ElementImportOneService
$element->setOldId($row['id']);
$element->setName($row['name']);
$address = new PostalAddress($row['streetAddress'], $row['addressLocality'], $row['postalCode'], $row["addressCountry"]);
$address = new PostalAddress($row['streetAddress'], $row['addressLocality'], $row['postalCode'], $row["addressCountry"], $row['customFormatedAddress']);
$element->setAddress($address);
$defaultSourceName = $import ? $import->getSourceName() : 'Inconnu';
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment