performance optimizations
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user