AddressDB/Export: added value cache for address data

This commit is contained in:
Frank Schubert
2023-01-17 15:25:11 +01:00
parent b41b76ecaf
commit 3fe324d762
2 changed files with 18 additions and 5 deletions
+13
View File
@@ -42,4 +42,17 @@ class Layout extends mfLayout {
public static function intToDate($int) {
return date("d.m.Y", $int);
}
/*
* Gets mfBaseModel object from Cache or gets in from DB and saves it in Cache
*/
public static function getMfValuecacheObject($objectname, $id) {
$object = mfValuecache::singleton()->get("mfObjectmodel-$objectname-".$id);
if(!$object) {
$object = new $objectname($id);
mfValuecache::singleton()->set("mfObjectmodel-$objectname-".$id, $object);
}
return $object;
}
}