Back to PhocacartTag class

Method getTagsByIds

public static
getTagsByIds
(mixed $cids)

Method getTagsByIds - Source code

public static function getTagsByIds($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_tags_related AS r ON a.id = r.tag_id' . ' WHERE a.type = 0' . ' AND r.item_id IN (' . $cids . ')' . ' ORDER BY a.id';
        $db->setQuery($query);
        $tags = $db->loadColumn();
        $tags = array_unique($tags);
        return $tags;
    }
    return array();
}