Refreshed a Country by Country Instance
@param Country $country
@return Ad
437380
public function refreshCountry(Country $country)
    {

        $refreshedCountry = $this->findCountryBy(array('id' => $country->getId()));
        if (null === $refreshedCountry) {
            throw new UsernameNotFoundException(sprintf('User with ID "%d" could not be reloaded.', $country->getId()));
        }
        return $refreshedCountry;
    }
483458
public function filterCountry($country = 'US')
    {
        return $this->filter(
            function ($key, $value) use ($country) {
                if ($value instanceof CountryFilter && $value->getIso31661() == $country) {
                    return true;
                }
            }
        );
    }
460124
public static function is_d1nation($country)
	{
		$d1nation = false;
		if ($country)
		{
			if (!($gdb = self::getGeoDBO()))
			{
				return $d1nation;
			}

			$gdb->setQuery("SELECT COUNT(*) FROM countrygroup WHERE LOWER(countrycode) = LOWER(" . $gdb->quote($country) . ") AND countrygroup = 'D1'");
			$c = $gdb->loadResult();
			if ($c > 0)
			{
				$d1nation = true;
			}
		}
		return $d1nation;
	}
693012
public function create(Country &$country)
    {
        $data = $country->exportData();
        $endpoint = '/admin/countries.json';
        $response = $this->request(
            $endpoint, 'POST', array(
            'country' => $data
            )
        );
        $country->setData($response['country']);
    }
988839
public function addCountry(\BlackForest\PiwikBundle\Entity\PiwikCountry $country)
    {
        $this->country[] = $country;

        return $this;
    }
1063760
public function setCountry($country)
    {
        if ($country === null) {
            throw new Klarna_ArgumentNotSetException('Country');
        }
        if (is_numeric($country)) {
            if (!is_int($country)) {
                $country = intval($country);
            }
            $this->country = $country;
            return;
        }
        if (strlen($country) == 2 || strlen($country) == 3) {
            $this->setCountry(KlarnaCountry::fromCode($country));
            return;
        }
        throw new KlarnaException("Failed to set country! ($country)");
    }
740490
protected function buildCountry(
        string $countryIso3
    ) {
        $country = $this->findCountryByIso3->__invoke(
            $countryIso3
        );

        if (empty($country)) {
            throw new CountryNotFoundException(
                "Country {$countryIso3} could not be found."
            );
        }

        return $country;
    }
145911
public function getAreaForCountry(Country $country)
    {
        $area = null;

        if (null !== $areaDeliveryModule = AreaDeliveryModuleQuery::create()->findByCountryAndModule(
            $country,
            $this->getModuleModel()
        )) {
            $area = $areaDeliveryModule->getArea();
        }

        return $area;
    }
573325
public function setCountryId($v)
    {
        if ($v !== null && is_numeric($v)) {
            $v = (int) $v;
        }

        if ($this->country_id !== $v) {
            $this->country_id = $v;
            $this->modifiedColumns[] = CustomerPeer::COUNTRY_ID;
        }

        if ($this->aCountry !== null && $this->aCountry->getId() !== $v) {
            $this->aCountry = null;
        }


        return $this;
    }
1173406
protected function updateCountry()
    {
        $this->controlAccess('country_edit');

        if ($this->country->update($this->data_country['code'], $this->getSubmitted())) {
            $this->redirect('admin/settings/country', $this->text('Country has been updated'), 'success');
        }

        $this->redirect('', $this->text('Country has not been updated'), 'warning');
    }
850137
public function setCurrency($country = null)
    {
        if (is_null($country)) {
            $country = config('currency.default');
        }
        $config = config('currency.' . $country);
        if (empty($config)) {
            throw new CurrencyNotAvaialbleException($country . ' currency not avaialble.');
        }
        $this->currency = $config;

        return $this;
    }
394012
public function country(string $country): string
    {
        if (!Configure::read('countries')) {
            Configure::load('CkTools.countries');
        }
        $countries = Configure::read('countries');

        return $countries[$country] ?? $country;
    }
857194
public function updateCountry(Country $country, $andFlush = true)
    {
        $this->objectManager->persist($country);
        if ($andFlush) {
            $this->objectManager->flush();
        }
    }
1148835
public function To($country)
    {
        $country = $this->library->getMetadataForRegion($country);
        $this->instance->setCountryCode($country->getCountryCode());
        return $this;
    }
1273289
public function refresh($account)
    {
        $identity = $this->identity($account);

        return $this->findByIdentity([$identity => $account->$identity]);
    }
523281
public function selectCountry($country)
    {
        if (!isset($this->_issuerData)) {
            $this->_country = $this->validateCountry($country);
            return $this;
        }

        if (in_array($country, $this->getCountries())) {
            $this->_country = $this->validateCountry($country);
            return $this;
        };

        if (in_array("00", $this->getCountries())) {
            $this->_country = "00";
        };

        return $this;
    }
596077
public final function setCountry($country) {
		if($country !== null)
			$this->country = mb_strtolower($country);
		else
			$this->country = null;
	}