Switched Preorder building source to AddressDB
This commit is contained in:
@@ -1,11 +1,8 @@
|
||||
<?php
|
||||
|
||||
class ADBHausnummer extends mfBaseModel {
|
||||
public $strasse;
|
||||
public $plz;
|
||||
public $status;
|
||||
public $providers = [];
|
||||
public $providerlist = [];
|
||||
private $strasse;
|
||||
private $plz;
|
||||
|
||||
protected function init() {
|
||||
$this->db = FronkDB::singleton(ADDRESSDB_DBHOST, ADDRESSDB_DBUSER, ADDRESSDB_DBPASS, ADDRESSDB_DBNAME);
|
||||
@@ -13,8 +10,35 @@ class ADBHausnummer extends mfBaseModel {
|
||||
}
|
||||
|
||||
public function afterLoad() {
|
||||
$this->strasse = new ADBStrasse($this->strasse_id);
|
||||
$this->plz = new ADBPlz($this->plz_id);
|
||||
//$this->strasse = new ADBStrasse($this->strasse_id);
|
||||
//$this->plz = new ADBPlz($this->plz_id);
|
||||
}
|
||||
|
||||
|
||||
public function getProperty($name) {
|
||||
if($this->$name == null) {
|
||||
|
||||
if($name == "strasse") {
|
||||
$this->strasse = new ADBStrasse($this->strasse_id);
|
||||
return $this->strasse;
|
||||
}
|
||||
|
||||
if($name == "plz") {
|
||||
$this->plz = new ADBPlz($this->plz_id);
|
||||
return $this->plz;
|
||||
}
|
||||
|
||||
$classname = ucfirst($name);
|
||||
$idfield = $name."_id";
|
||||
$this->$name = new $classname($this->$idfield);
|
||||
|
||||
if($this->$name->id) {
|
||||
return $this->$name;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->$name;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user