Back to PhocacartTag class

Method getTagsLabelsByIds

public static
getTagsLabelsByIds
(mixed $cids)

Method getTagsLabelsByIds - Source code

public static function getTagsLabelsByIds($cids)
{
    $db = Factory::getDBO();
    if ($cids != '') {
        //cids is string separated by comma
        $query = 'SELECT r.tag_id FROM #__phocacart_tags AS a' . ' LEFT JOIN #__phocacart_taglabels_related AS r ON a.id = r.tag_id' . ' WHERE a.type = 1' . ' AND r.item_id IN (' . $cids . ')' . ' ORDER BY a.id';
        $db->setQuery($query);
        $tags = $db->loadColumn();
        $tags = array_unique($tags);
        return $tags;
    }
    return array();
}