Back to PhocacartTag class

Method getActiveLabels

public static
getActiveLabels
(mixed $items, mixed $ordering)

Method getActiveLabels - Source code

public static function getActiveLabels($items, $ordering)
{
    $db = Factory::getDbo();
    $o = array();
    $wheres = array();
    $ordering = PhocacartOrdering::getOrderingText($ordering, 3);
    //t
    if ($items != '') {
        $wheres[] = 't.id IN (' . $items . ')';
        $wheres[] = 't.type = 1';
        $q = 'SELECT DISTINCT t.title, CONCAT(t.id, \'-\', t.alias) AS alias, \'tag\' AS parameteralias, \'tag\' AS parametertitle FROM #__phocacart_tags AS t' . (!empty($wheres) ? ' WHERE ' . implode(' AND ', $wheres) : '') . ' GROUP BY t.alias, t.title' . ' ORDER BY ' . $ordering;
        $db->setQuery($q);
        $o = $db->loadAssocList();
    }
    return $o;
}