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