Rimo Import RML
This commit is contained in:
@@ -108,9 +108,11 @@ class AddressHelper
|
||||
|
||||
$create_address_parts = false;
|
||||
$update_freigabe = false;
|
||||
$update_address = false;
|
||||
if ($this->netzgebiet) {
|
||||
$create_address_parts = $this->netzgebiet->getOption("create_address_parts");
|
||||
$update_freigabe = $this->netzgebiet->getOption("update_freigabe");
|
||||
$update_address = $this->netzgebiet->getOption("update_address");
|
||||
}
|
||||
|
||||
|
||||
@@ -308,31 +310,33 @@ class AddressHelper
|
||||
}
|
||||
}
|
||||
|
||||
if($strasse_name != $hausnummer->strasse->name) {
|
||||
$new_strasse = ADBStrasseModel::getFirst(["gemeinde_id" => $gemeinde_id, "name" => $strasse_name]);
|
||||
if($new_strasse) {
|
||||
$this->logFindAddressError("[II] Updating Strasse from ".$hausnummer->strasse->name." to ".$new_strasse->name." ($addr_dbg_str)");
|
||||
$hausnummer->strasse_id = $new_strasse->id;
|
||||
$hausnummer->save;
|
||||
} else {
|
||||
$this->logFindAddressError("[WW] Cannot update Strasse from ".$hausnummer->strasse->name." to ".$strasse_name." because not found ($addr_dbg_str)");
|
||||
if($update_address) {
|
||||
if ($strasse_name != $hausnummer->strasse->name) {
|
||||
$new_strasse = ADBStrasseModel::getFirst(["gemeinde_id" => $gemeinde_id, "name" => $strasse_name]);
|
||||
if ($new_strasse) {
|
||||
$this->logFindAddressError("[II] Updating Strasse from " . $hausnummer->strasse->name . " to " . $new_strasse->name . " ($addr_dbg_str)");
|
||||
$hausnummer->strasse_id = $new_strasse->id;
|
||||
$hausnummer->save;
|
||||
} else {
|
||||
$this->logFindAddressError("[WW] Cannot update Strasse from " . $hausnummer->strasse->name . " to " . $strasse_name . " because not found ($addr_dbg_str)");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if($hausnummer_name != $hausnummer->hausnummer) {
|
||||
$this->logFindAddressError("[II] Updating Hausnummer from ".$hausnummer->hausnummer." to ".$hausnummer_name." ($addr_dbg_str)");
|
||||
$hausnummer->hausnummer = $hausnummer_name;
|
||||
$hausnummer->save;
|
||||
}
|
||||
|
||||
if($plz_name != $hausnummer->plz->plz) {
|
||||
$new_plz = ADBPlzModel::getFirst(["gemeinde_id" => $gemeinde_id, "plz" => $plz_name]);
|
||||
if($new_plz) {
|
||||
$this->logFindAddressError("[II] Updating PLZ from ".$hausnummer->plz->plz." to ".$new_plz->plz." ($addr_dbg_str)");
|
||||
$hausnummer->plz_id = $new_plz->id;
|
||||
if ($hausnummer_name != $hausnummer->hausnummer) {
|
||||
$this->logFindAddressError("[II] Updating Hausnummer from " . $hausnummer->hausnummer . " to " . $hausnummer_name . " ($addr_dbg_str)");
|
||||
$hausnummer->hausnummer = $hausnummer_name;
|
||||
$hausnummer->save;
|
||||
} else {
|
||||
$this->logFindAddressError("[WW] Cannot update PLZ from ".$hausnummer->plz->plz." to ".$plz_name." because not found ($addr_dbg_str)");
|
||||
}
|
||||
|
||||
if ($plz_name != $hausnummer->plz->plz) {
|
||||
$new_plz = ADBPlzModel::getFirst(["gemeinde_id" => $gemeinde_id, "plz" => $plz_name]);
|
||||
if ($new_plz) {
|
||||
$this->logFindAddressError("[II] Updating PLZ from " . $hausnummer->plz->plz . " to " . $new_plz->plz . " ($addr_dbg_str)");
|
||||
$hausnummer->plz_id = $new_plz->id;
|
||||
$hausnummer->save;
|
||||
} else {
|
||||
$this->logFindAddressError("[WW] Cannot update PLZ from " . $hausnummer->plz->plz . " to " . $plz_name . " because not found ($addr_dbg_str)");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user