static function getParentCategoriesByRoute($parent_route, $order = 'ASC') { if (empty($parent_route)) { return array(); } if (!is_array($parent_route)) { $routes = TemplateContentArticleHelper::getParentRoutes($parent_route); } else { $routes = $parent_route; } $db = JFactory::getDBO(); $query = $db->getQuery(true); $query->select('id, title, alias, CONCAT(id, ' . $db->Quote(':') . ',alias) AS catslug'); $query->from('#__categories'); foreach ($routes as &$route) { $route = 'path = ' . $db->Quote($route); } $query->where('(' . implode(' OR ', $routes) . ') AND published = 1 AND alias <> ' . $db->Quote('root')); $query->order('level ' . $order); $db->setQuery($query); $result = $db->loadObjectList(); if (@is_null($result) || @empty($result)) { return array(); } return $result; }