Back to PhocacartManufacturer class

Method getManufacturers

public static
getManufacturers
(mixed $itemId, mixed $select = 0)

Method getManufacturers - Source code

public static function getManufacturers($itemId, $select = 0)
{
    $db = Factory::getDBO();
    if ($select == 1) {
        $query = 'SELECT a.id';
    } else {
        if ($select == 2) {
            $query = 'SELECT a.id, a.alias ';
        } else {
            $query = 'SELECT a.id, a.title, a.alias, a.type, a.display_format';
        }
    }
    $query .= ' FROM #__phocacart_manufacturers AS a' . ' LEFT JOIN #__phocacart_products AS p ON a.id = p.manufacturer_id' . ' WHERE p.id = ' . (int) $itemId . ' ORDER BY a.id';
    $db->setQuery($query);
    if ($select == 1) {
        $tags = $db->loadColumn();
    } else {
        $tags = $db->loadObjectList();
    }
    return $tags;
}