Back to PhocacartGroup class

Method getAllGroups

public static
getAllGroups
(mixed $order = 'id')

Method getAllGroups - Source code

public static function getAllGroups($order = 'id')
{
    $db = Factory::getDBO();
    $query = 'SELECT a.id AS value, a.title AS text' . ' FROM #__phocacart_groups AS a' . ' ORDER BY ' . $order;
    $db->setQuery($query);
    $groups = $db->loadObjectList();
    foreach ($groups as $k => $v) {
        $groups[$k]->text = Text::_($v->text);
    }
    return $groups;
}