mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Add support for Rows besides Cells in Object-Cache
This commit is contained in:
@@ -95,7 +95,10 @@ class ObjCache implements ArrayAccess {
|
|||||||
return $GLOBALS['_ObjCache'][$this->obj][$obj]['value'];
|
return $GLOBALS['_ObjCache'][$this->obj][$obj]['value'];
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$GLOBALS['_ObjCache'][$this->obj][$obj]['value'] = dbFetchCell($this->data[$obj]['query'], $this->data[$obj]['params']);
|
$GLOBALS['_ObjCache'][$this->obj][$obj]['value'] = dbFetchRows($this->data[$obj]['query'], $this->data[$obj]['params']);
|
||||||
|
if (sizeof($GLOBALS['_ObjCache'][$this->obj][$obj]['value']) == 1 && sizeof($GLOBALS['_ObjCache'][$this->obj][$obj]['value'][0]) == 1) {
|
||||||
|
$GLOBALS['_ObjCache'][$this->obj][$obj]['value'] = current($GLOBALS['_ObjCache'][$this->obj][$obj]['value'][0]);
|
||||||
|
}
|
||||||
return $GLOBALS['_ObjCache'][$this->obj][$obj]['value'];
|
return $GLOBALS['_ObjCache'][$this->obj][$obj]['value'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user