Changed to rimo impot
This commit is contained in:
@@ -70,6 +70,15 @@ class ADBWohneinheitModel {
|
||||
$res = $db->query($sql);
|
||||
if($db->num_rows($res)) {
|
||||
$data = $db->fetch_object($res);
|
||||
|
||||
// search in cache
|
||||
$item = mfValuecache::singleton()->get("mfObjectmodel-adb_wohneinheit-".$data->id);
|
||||
if($item && $item->id) {
|
||||
mfValuecache::singleton()->set("mfObjectmodel-adb_wohneinheit-".$data->id, $item);
|
||||
return $item;
|
||||
}
|
||||
// if not in cache, load regularly
|
||||
|
||||
$item = new ADBWohneinheit($data);
|
||||
if($item->id) {
|
||||
return $item;
|
||||
@@ -140,7 +149,14 @@ class ADBWohneinheitModel {
|
||||
$res = $db->query($sql);
|
||||
if($db->num_rows($res)) {
|
||||
while($data = $db->fetch_object($res)) {
|
||||
$items[] = new ADBWohneinheit($data);
|
||||
$item = mfValuecache::singleton()->get("mfObjectmodel-adb_wohneinheit-".$data->id);
|
||||
if($item && $item->id) {
|
||||
$items[] = $item;
|
||||
} else {
|
||||
$item = new ADBWohneinheit($data);
|
||||
mfValuecache::singleton()->set("mfObjectmodel-adb_wohneinheit-".$data->id, $item);
|
||||
$items[] = $item;
|
||||
}
|
||||
}
|
||||
}
|
||||
return $items;
|
||||
|
||||
Reference in New Issue
Block a user