40 lines
973 B
PHP
40 lines
973 B
PHP
<?php
|
|
|
|
class PreordercampaignOperatorIsp extends mfBaseModel
|
|
{
|
|
private $isp;
|
|
|
|
protected function beforeUpdate($data) {
|
|
if(!array_key_exists("edit_by", $data)) {
|
|
$me = new User();
|
|
$me->loadMe();
|
|
$data["edit_by"] = $me->id;
|
|
}
|
|
|
|
return $data;
|
|
}
|
|
|
|
public function getProperty($name) {
|
|
if($this->$name == null) {
|
|
|
|
if($name == "isp") {
|
|
$isp = mfValuecache::singleton()->getMfObject("Address", $this->isp_id);
|
|
if(!$isp) {
|
|
return null;
|
|
}
|
|
|
|
$this->isp = $isp;
|
|
return $this->isp;
|
|
}
|
|
|
|
$classname = ucfirst($name);
|
|
$idfield = $name."_id";
|
|
$this->$name = mfValuecache::singleton()->getMfObject($classname, $this->$idfield);
|
|
if(!$this->$name) {
|
|
return null;
|
|
}
|
|
}
|
|
|
|
return $this->$name;
|
|
}
|
|
} |