Back to PhocacartRegion class

Method getRegionById

public static
getRegionById
(mixed $regionId)

Method getRegionById - Source code

public static function getRegionById($regionId)
{
    $db = Factory::getDBO();
    $query = 'SELECT title FROM #__phocacart_regions WHERE id = ' . (int) $regionId . ' ORDER BY title LIMIT 1';
    $db->setQuery($query);
    $region = $db->loadColumn();
    if (isset($region[0])) {
        return (string) $region[0];
    }
    return '';
}