AddressDB/Export: added value cache for address data
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user