From ced49e02d461f589cabdcbae78e058e81d9c464c Mon Sep 17 00:00:00 2001 From: Daniel Preussker Date: Sun, 27 Sep 2015 15:34:43 +0000 Subject: [PATCH] Add support for Rows besides Cells in Object-Cache --- includes/object-cache.inc.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/includes/object-cache.inc.php b/includes/object-cache.inc.php index 61cea53235..dfb81621e7 100644 --- a/includes/object-cache.inc.php +++ b/includes/object-cache.inc.php @@ -95,7 +95,10 @@ class ObjCache implements ArrayAccess { return $GLOBALS['_ObjCache'][$this->obj][$obj]['value']; } 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']; } }