Performance optimizations

This commit is contained in:
Frank Schubert
2022-02-16 00:10:43 +01:00
parent 8a200da3f0
commit e61ffa652e
4 changed files with 47 additions and 10 deletions

View File

@@ -30,12 +30,14 @@ class Workflowitem extends mfBaseModel {
return $value;
}
$value = WorkflowvalueModel::getFirst(['item_id' => $this->id, "object_id" => $this->object_id]);
// explicitly cache empty value
mfValuecache::singleton()->set("wfItemvalue-item-".$this->id."-object-".$this->object_id, $value);
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;
}