ShopConfig::getCountriesList PHP Method

getCountriesList() public method

Get list of allowed countries
public getCountriesList ( boolean $prefixisocode = false ) : array
$prefixisocode boolean - prefix the country code
return array
    public function getCountriesList($prefixisocode = false)
    {
        $countries = self::config()->iso_3166_country_codes;
        asort($countries);
        if ($allowed = $this->owner->AllowedCountries) {
            $allowed = explode(",", $allowed);
            if (count($allowed > 0)) {
                $countries = array_intersect_key($countries, array_flip($allowed));
            }
        }
        if ($prefixisocode) {
            foreach ($countries as $key => $value) {
                $countries[$key] = "{$key} - {$value}";
            }
        }
        return $countries;
    }