Switched Preorder building source to AddressDB
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
<?php
|
||||
|
||||
class ADBStrasse extends mfBaseModel {
|
||||
public $gemeinde = [];
|
||||
private $ortschaft;
|
||||
private $gemeinde;
|
||||
|
||||
protected function init() {
|
||||
$this->db = FronkDB::singleton(ADDRESSDB_DBHOST, ADDRESSDB_DBUSER, ADDRESSDB_DBPASS, ADDRESSDB_DBNAME);
|
||||
@@ -9,7 +10,35 @@ class ADBStrasse extends mfBaseModel {
|
||||
}
|
||||
|
||||
public function afterLoad() {
|
||||
$this->gemeinde = new ADBGemeinde($this->gemeinde_id);
|
||||
//$this->gemeinde = new ADBGemeinde($this->gemeinde_id);
|
||||
}
|
||||
|
||||
public function getProperty($name) {
|
||||
if($this->$name == null) {
|
||||
|
||||
if($name == "ortschaft") {
|
||||
$this->ortschaft = new ADBOrtschaft($this->ortschaft_id);
|
||||
return $this->ortschaft;
|
||||
}
|
||||
|
||||
if($name == "gemeinde") {
|
||||
$this->gemeinde = new ADBGemeinde($this->gemeinde_id);
|
||||
return $this->gemeinde;
|
||||
}
|
||||
|
||||
|
||||
$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