35 lines
701 B
PHP
35 lines
701 B
PHP
<?php
|
|
|
|
class XinonFibuMerge extends mfBaseModel {
|
|
private $address;
|
|
|
|
public function getProperty($name) {
|
|
if($this->$name == null) {
|
|
|
|
if(!$this->id) {
|
|
return null;
|
|
}
|
|
|
|
if($name == "address") {
|
|
if(!$this->old_custnum) return null;
|
|
|
|
$address = new Address($this->old_custnum);
|
|
if(!$address->id) return null;
|
|
return $address;
|
|
}
|
|
|
|
|
|
$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;
|
|
}
|
|
} |