Get country

If no "country" value has been set, this method will
set and return a default "country" value,
if any such value is available

@see getDefaultCountry()

@return string|null country or null if no country has been set
425392
public function getCountry() : ?string 
    {
        if ( ! $this->hasCountry()) {
            $this->setCountry($this->getDefaultCountry());
        }
        return $this->country;
    }
419059
public static function getcountries()
	{
		$countries = array();

		if (!($gdb = self::getGeoDBO()))
		{
			return $countries;
		}

		$gdb->setQuery("SELECT code, name FROM countries ORDER BY name");
		$results = $gdb->loadObjectList();

		if ($results)
		{
			foreach ($results as $row)
			{
				if ($row->code != '-' && $row->name != '-')
				{
					array_push($countries, array(
						'code' => strtolower($row->code),
						'id'   => $row->code,
						'name' => $row->name
					));
				}
			}
		}

		return $countries;
	}
500703
public function getRegion() : ?string 
    {
        if ( ! $this->hasRegion()) {
            $this->setRegion($this->getDefaultRegion());
        }
        return $this->region;
    }
212143
static function fetchCountryList()
    {
        if ( isset( $GLOBALS['CountryList'] ) )
            return $GLOBALS['CountryList'];

        $ini = eZINI::instance( 'country.ini' );
        $countries = $ini->getNamedArray();
        eZCountryType::fetchTranslatedNames( $countries );
        $GLOBALS['CountryList'] = $countries;
        return $countries;
    }
349750
public function getDefault() {
		if( is_object($this->default) ) {
			$this->default = call_user_func_array($this->default->type, (array) $this->default->args);
		} else
		if( defined($this->default) ) {
			return constant($this->default);
		}
		return $this->default;
	}
977908
public function getDefaultDomain()
    {
        if ($this->defaultDomain) {
            return $this->defaultDomain;
        } elseif ($first = $this->getDomains()->first()) {
            return $first->getDomain();
        } else {
            return null;
        }
    }
1331325
public function getCountry($id)
    {
        foreach ($this->data as $country) {
            if (strtoupper($id) == (string) $country) {
                return $country;
            }
        }

        return null;
    }
429070
protected function _getDefaultValues()
    {
        $teamComponent = $this->_data->parent->parent->parent;
        if (Kwc_Abstract::hasSetting($teamComponent->componentClass, 'defaultVcardValues')) {
            $setting = Kwc_Abstract::getSetting($teamComponent->componentClass, 'defaultVcardValues');
        }

        if (isset($setting)) {
            return $setting;
        } else {
            return Kwc_Abstract::getSetting($this->_data->componentClass, 'defaultVcardValues');
        }
    }
1300748
public function getCountryLabel($strCountry)
    {
        $countries = $this->getCountries();

        return isset($countries[$strCountry]) ? $countries[$strCountry] : null;
    }
424529
private function getCountries()
    {
        $countries = [];
        foreach (Intl::getRegionBundle()->getCountryNames() as $countryCode => $countryName) {
            $countries[strtolower($countryCode)] = new PropertyParameter(strtolower($countryCode), $countryName);
        }

        return $countries;
    }
1130084
public function getDefaultSiteValues()
    {
        $data = $this->getDefaultSiteSettings();

        // Site Id
        if (empty($data['siteId'])) {
            $data['siteId'] = null;
        }

        // Language
        if (empty($data['languageIso6392t'])) {
            throw new \Exception(
                'languageIso6392t default is required to create new site.'
            );
        }

        // Country
        if (empty($data['countryId'])) {
            throw new \Exception(
                'CountryId default is required to create new site.'
            );
        }

        return $this->prepareSiteData($data);
    }
730158
public function getCountry()
    {
        $countryCode = $this->getImprintValue('country');
        if (!$countryCode) {
            return '';
        }

        try {
            $countryInfo = $this->countryInformationAcquirer->getCountryInfo($countryCode);
            $countryName = $countryInfo->getFullNameLocale();
        } catch (NoSuchEntityException $e) {
            $countryName = '';
        }

        return $countryName;
    }
224598
public function getCountryList()
    {
        if ($this->_oCountryList === null) {
            // passing country list
            $this->_oCountryList = oxNew(\OxidEsales\Eshop\Application\Model\CountryList::class);
            $this->_oCountryList->loadActiveCountries();
        }

        return $this->_oCountryList;
    }
976156
public function getValue()
    {
        $value = $this->getModelValue();
        if (is_null($value)) {
            $value = $this->getDefaultValue();
        }

        return $value;
    }
1222199
public function getLocale() : ?string 
    {
        if ( ! $this->hasLocale()) {
            $this->setLocale($this->getDefaultLocale());
        }
        return $this->locale;
    }
654602
protected function validateCountryAddress()
    {
        $field = 'country';
        $value = $this->getSubmitted($field);

        if (!isset($value)) {
            $this->unsetSubmitted($field);
            return null;
        }

        $country = $this->country->get($value);
        $label = $this->translation->text('Country');

        if (empty($country)) {
            $this->setErrorUnavailable($field, $label);
            return false;
        }

        return true;
    }
797984
protected function getCurrency()
    {
        if (null === $this->currency) {
            $this->currency = $this->getSession() ? $this->getSession()->getCurrency(true) : Currency::getDefaultCurrency();
        }

        return $this->currency;
    }