Added some linked data in Order to cache
This commit is contained in:
@@ -278,7 +278,13 @@ class Termination extends mfBaseModel {
|
||||
if($this->$name == null) {
|
||||
|
||||
if($name == "status") {
|
||||
$this->status = TerminationstatusModel::getOne($this->status_id);
|
||||
$this->status = mfValuecache::singleton()->get("wfStatus-".$this->status_id);
|
||||
if($this->status === null) {
|
||||
$this->status = TerminationstatusModel::getOne($this->status_id);
|
||||
if($this->status->id) {
|
||||
mfValuecache::singleton()->set("wfStatus-".$this->status_id, $this->status);
|
||||
}
|
||||
}
|
||||
return $this->status;
|
||||
}
|
||||
|
||||
@@ -293,7 +299,14 @@ class Termination extends mfBaseModel {
|
||||
}
|
||||
|
||||
if($name == "lineworker") {
|
||||
$this->lineworker = new Address($this->getProperty("building")->lineworker_id);
|
||||
$lineworker_id = $this->getProperty("building")->lineworker_id;
|
||||
$this->lineworker = mfValuecache::singleton()->get("mfObjectmodel-Address-$lineworker_id");
|
||||
if($this->lineworker === null) {
|
||||
$this->lineworker = new Address($this->getProperty("building")->lineworker_id);
|
||||
if($this->lineworker->id) {
|
||||
mfValuecache::singleton()->set("mfObjectmodel-Address-$lineworker_id", $this->lineworker);
|
||||
}
|
||||
}
|
||||
return $this->lineworker;
|
||||
}
|
||||
|
||||
@@ -316,7 +329,9 @@ class Termination extends mfBaseModel {
|
||||
$this->linework_enabler = mfValuecache::singleton()->get("Worker-id-".$this->linework_enabled_by);
|
||||
if(!$this->linework_enabler) {
|
||||
$this->linework_enabler = new User($this->linework_enabled_by);
|
||||
mfValuecache::singleton()->set("Worker-id-".$this->linework_enabled_by, $this->linework_enabler);
|
||||
if($this->linework_enabler->id) {
|
||||
mfValuecache::singleton()->set("Worker-id-".$this->linework_enabled_by, $this->linework_enabler);
|
||||
}
|
||||
}
|
||||
return $this->linework_enabler;
|
||||
}
|
||||
@@ -342,7 +357,7 @@ class Termination extends mfBaseModel {
|
||||
$classname = ucfirst($name);
|
||||
$idfield = $name."_id";
|
||||
$this->$name = mfValuecache::singleton()->get("mfObjectmodel-$name-".$this->$idfield);
|
||||
if(!$this->$name) {
|
||||
if($this->$name === null) {
|
||||
$this->$name = new $classname($this->$idfield);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user