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

View File

@@ -83,18 +83,18 @@ class Building extends mfBaseModel {
foreach(WorkflowitemModel::search(["object_type" => "building", "active" => 1]) as $item) {
$item->setObjectId($this->id);
$this->workflowitems[$item->name] = $item;
mfValuecache::set("wfBuilding-".$item->name, $item);
mfValuecache::singleton()->set("wfBuilding-".$item->name, $item);
}
}
public function getWorkflowvalue($itemname, $type = false) {
$item = mfValuecache::get("wfBuilding-".$itemname);
$item = mfValuecache::singleton()->get("wfBuilding-".$itemname);
if(!$item) {
$item = WorkflowitemModel::getFirst(['name' => $itemname]);
if(!$item->id) {
return null;
}
mfValuecache::set("wfBuilding-".$itemname, $item);
mfValuecache::singleton()->set("wfBuilding-".$itemname, $item);
}
switch($item->type) {