public function buildPath(&$paths, $categoryID) { if (empty($categoryID)) { return; } $db = Factory::getDBO(); $db->setQuery("SELECT *\n FROM `#__categories`\n WHERE extension='com_osdownloads'\n AND id = " . $db->q((int) $categoryID)); $category = $db->loadObject(); if ($category) { $paths[] = $category; } if ($category && $category->parent_id) { $this->buildPath($paths, $category->parent_id); } }
public function getList() { $db = Factory::getDBO(); $osdownloads = FreeComponentSite::getInstance(); $model = $osdownloads->getModel('Item'); $query = $model->getItemQuery(); $query->where("cate_id = " . $db->quote($this->params->get('category', 0))); $db->setQuery($query); $rows = $db->loadObjectList(); if (!empty($rows)) { foreach ($rows as &$row) { $row->agreementLink = JRoute::_('index.php?option=com_content&view=article&id=' . (int) $row->agreement_article_id); } } return $rows; }