Files
thetool/application/AddressLink/AddressLink.php
Frank Schubert bbfc6c6eb5 AddessLink WIP
2022-06-28 13:25:37 +02:00

32 lines
632 B
PHP

<?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;
}
}