diff --git a/components/com_content/models/categories.php b/components/com_content/models/categories.php index 93bc8b9f47754..cc1764d6f050f 100644 --- a/components/com_content/models/categories.php +++ b/components/com_content/models/categories.php @@ -34,8 +34,6 @@ class ContentModelCategories extends JModelList private $_parent = null; - private $_items = null; - /** * Method to auto-populate the model state. * @@ -91,7 +89,9 @@ protected function getStoreId($id = '') */ public function getItems($recursive = false) { - if (!count($this->_items)) + $store = $this->getStoreId(); + + if (!isset($this->cache[$store])) { $app = JFactory::getApplication(); $menu = $app->getMenu(); @@ -110,14 +110,14 @@ public function getItems($recursive = false) if (is_object($this->_parent)) { - $this->_items = $this->_parent->getChildren($recursive); + $this->cache[$store] = $this->_parent->getChildren($recursive); } else { - $this->_items = false; + $this->cache[$store] = false; } } - return $this->_items; + return $this->cache[$store]; } public function getParent()