Back to PhocacartSection class

Method getSections

public static
getSections
(mixed $limit = 0)

Method getSections - Source code

public static function getSections($limit = 0)
{
    $db = Factory::getDBO();
    $query = ' SELECT a.id, a.title FROM #__phocacart_sections AS a' . ' WHERE a.published = 1' . ' ORDER BY a.ordering';
    if ((int) $limit > 0) {
        $query .= ' LIMIT ' . (int) $limit;
    }
    $db->setQuery($query);
    $sections = $db->loadObjectList();
    return $sections;
}