AddessLink WIP

This commit is contained in:
Frank Schubert
2022-06-28 13:25:37 +02:00
parent a6652c5ab8
commit bbfc6c6eb5
7 changed files with 393 additions and 2 deletions

View File

@@ -0,0 +1,32 @@
<?php
class AddressLink extends mfBaseModel {
private $address;
private $origin;
public function getProperty($name) {
if($this->$name == null) {
if(!$this->id) {
return null;
}
if($name == "origin") {
$this->origin = new Address($this->origin_address_id);
return $this->origin;
}
$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;
}
}