Switch active country by code
@param string $sCountryCode
480563
public function switchCountry($sCountryCode)
    {
        if (empty($sCountryCode) || !PluginManager::instance()->hasPlugin('RainLab.Location')) {
            return;
        }

        $this->obActiveCountry = \RainLab\Location\Models\Country::whereCode($sCountryCode)->first();
    }
500560
protected function setCountryCity($country_code)
    {
        $this->data_country = $this->country->get($country_code);

        if (empty($this->data_country)) {
            $this->outputHttpStatus(404);
        }
    }
417598
private function getCountryByCode($code)
    {
        // Check if country exist in cache.
        if (array_key_exists($code, $this->countries)) {
            return $this->countries[$code];
        }
        // Fetch country.
        $country = $this->manager->getRepository(static::$countryEntityName)->findOneBy(['code' => $code]);
        if (!$country) {
            throw new \Doctrine\ORM\EntityNotFoundException('code = ' . $code);
        }
        // Add country to cache.
        $this->countries[$code] = $country;

        return $country;
    }
1122945
public function findTimezones($countryCode)
    {
        return $this->helper->loadJson(
            $this->helper->dataDir('timezones/countries/default/'.strtolower($countryCode).'.json')
        );
    }
699440
public function attemptActivation($activationCode)
	{
		if ($this->activated)
		{
			throw new UserAlreadyActivatedException('Cannot attempt activation on an already activated user.');
		}

		if ($activationCode == $this->activation_code)
		{
			$this->activation_code = null;
			$this->activated       = true;
			$this->activated_at    = new DateTime;
			return $this->save();
		}

		return false;
	}
1065757
public function editCurrency($code = null)
    {
        $this->setCurrency($code);
        $this->setTitleEditCurrency();
        $this->setBreadcrumbEditCurrency();

        $this->setData('edit', isset($code));
        $this->setData('currency', $this->data_currency);
        $this->setData('can_delete', $this->canDeleteCurrency());
        $this->setData('default_currency', $this->currency->getDefault());

        $this->submitEditCurrency();
        $this->outputEditCurrency();
    }
287473
public function isActive($code)
    {
        return $code && (bool) Arr::get($this->getCurrency($code), 'active', false);
    }
964685
public final void setCountry(final Countries pCountry) {
    this.country = pCountry;
    if (this.itsId == null) {
      this.itsId = new IdLangPreferences();
    }
    this.itsId.setCountry(this.country);
  }
712696
public final function setCountryISOCode($countryISOCode) {
		if($countryISOCode !== null)
			$this->countryISOCode = mb_strtoupper($countryISOCode);
		else
			$this->countryISOCode = null;
	}
597863
public function setCode(string $code)
    {
        if ($code) {
            $this->selectLocale = strtolower($code);
            $this->ready = true;    // set ready for use locale
            $this->checkLocale();
        }
//        \Tracy\Debugger::fireLog('setCode: ' . $code);
    }
312220
public function getCurrencyIdByCode($code) {
        $this->sError = FALSE;

        if ($this->_currencyCode2Id === FALSE) {
            $this->_loadCurrencyCodes();
        }

        if (!isset($this->_currencyCode2Id[$code])) {
            $this->sError = 'Incorect currency code: ' . $code;
            return FALSE;
        }

        return $this->_currencyCode2Id[$code];
    }
897861
public function setStatus(int $code, string $reason = null)
    {
        $this->status = $this->validateStatusCode($code);
        $this->reason = $reason ?? Status::getReason($this->status);

        if ($this->upgrade && $this->status !== Status::SWITCHING_PROTOCOLS) {
            $this->upgrade = null;
        }
    }
154088
public function setStatusCode($code)
    {
        $code = (int) $code;

        if (!array_key_exists($code, $this->validStatusCodes)) {
            throw new Exceptions\InvalidStatusCodeException(
                "'$code' is an invalid status code"
            );
        }

        $this->statusCode = $code;

        return $this;
    }
436429
function setCurrentLanguage( $languageCode )
    {
        $this->CurrentLanguage = $languageCode;
        if ( $this->hasContentObject() )
        {
            $this->ContentObject->setCurrentLanguage( $languageCode );
        }
        $this->Name = null;
    }
1311072
public function country($code){
		$geo = Geo::getCountry($code);
		$this->applyFilter($geo);
		return \Response::json($geo);
	}
751903
protected static function countryCurrencyFormatter($countryCode)
    {
        $localeCode = Locale::countryLocaleCode($countryCode);

        return new \NumberFormatter($localeCode, \NumberFormatter::CURRENCY);
    }
956487
public function setCurrencyFromIsoAlpha3Code($isoAlpha3Code)
    {
        try {
            /** @var \Tx_Oelib_Mapper_Currency $mapper */
            $mapper = \Tx_Oelib_MapperRegistry::get(\Tx_Oelib_Mapper_Currency::class);
            $this->currency = $mapper->findByIsoAlpha3Code($isoAlpha3Code);
        } catch (Exception $exception) {
            $this->currency = null;
        }
    }