performance optimization
This commit is contained in:
@@ -145,7 +145,7 @@ class Workflowvalue extends mfBaseModel {
|
||||
}
|
||||
|
||||
if($name == "changer") {
|
||||
$user = mfValuecache::singleton()->get("Worker-id-".$this->changed);
|
||||
$user = mfValuecache::singleton()->get("Worker-id-".$this->changed_by);
|
||||
if($user) {
|
||||
$this->changer = $user;
|
||||
return $this->changer;
|
||||
@@ -153,7 +153,7 @@ class Workflowvalue extends mfBaseModel {
|
||||
if($this->changed && $this->changed_by) {
|
||||
$this->changer = new User($this->changed_by);
|
||||
if($this->changer->id) {
|
||||
mfValuecache::singleton()->set("Worker-id-".$this->changed, $this->changer);
|
||||
mfValuecache::singleton()->set("Worker-id-".$this->changed_by, $this->changer);
|
||||
}
|
||||
return $this->changer;
|
||||
} else {
|
||||
@@ -163,9 +163,13 @@ class Workflowvalue extends mfBaseModel {
|
||||
|
||||
$classname = ucfirst($name);
|
||||
$idfield = $name."_id";
|
||||
$this->$name = new $classname($this->$idfield);
|
||||
$this->$name = mfValuecache::singleton()->get("mfObjectmodel-$name-".$this->$idfield);
|
||||
if(!$this->$name) {
|
||||
$this->$name = new $classname($this->$idfield);
|
||||
}
|
||||
|
||||
if($this->$name->id) {
|
||||
mfValuecache::singleton()->set("mfObjectmodel-$name-".$this->$name->id, $this->$name);
|
||||
return $this->$name;
|
||||
} else {
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user