performance optimizations

This commit is contained in:
Frank Schubert
2022-02-15 23:12:19 +01:00
parent fa3dec263f
commit c189041b67
10 changed files with 72 additions and 36 deletions
+10
View File
@@ -12,6 +12,10 @@ class Workflowitem extends mfBaseModel {
return true;
}
public function setValue(Workflowvalue $value) {
$this->value = $value;
}
public function getProperty($name) {
if($this->$name == null) {
@@ -20,12 +24,18 @@ class Workflowitem extends mfBaseModel {
$this->log->warn(__CLASS__."::getProperty('value'): Object ID not set");
return null;
}
$value = mfValuecache::singleton()->get("wfItemvalue-item-".$this->id."-object-".$this->object_id);
if($value) {
$this->value = $value;
return $value;
}
$value = WorkflowvalueModel::getFirst(['item_id' => $this->id, "object_id" => $this->object_id]);
if(!$value) {
$vdata['item_id'] = $this->id;
$vdata['object_id'] = $this->object_id;
$value = WorkflowvalueModel::create($vdata);
}
mfValuecache::singleton()->set("wfItemvalue-item-".$this->id."-object-".$this->object_id, $value);
$this->value = $value;
return $this->value;
}