Set the country to which the phone number belongs to.

@param string|array $country
@return static
767775
public function ofCountry($country)
    {
        $countries = is_array($country) ? $country : func_get_args();

        $instance = clone $this;
        $instance->countries = array_unique(
            array_merge($instance->countries, static::parseCountries($countries))
        );

        return $instance;
    }
63586
public function setCountry(\OxidEsales\Eshop\Application\Model\Country $country)
    {
        $this->_oCountry = $country;
    }
674021
public function setAddress(array $address)
    {
        if (!empty($address) && is_array($address)) {
            $this->address = $address;
        }

        return $this;
    }
1043984
public function phoneFormatByCountry($phone, $country = 'BR', $format = 'n')
    {
        $phoneUtil = PhoneNumberUtil::getInstance();
        try {
            $phoneParse = $phoneUtil->parse($phone, $country);
        } catch (\libphonenumber\NumberParseException $e) {
            return null;
        }

        if ($format == 'n') {
            $method = PhoneNumberFormat::NATIONAL;
        } elseif ($format == 'i') {
            $method = PhoneNumberFormat::INTERNATIONAL;
        } else {
            $method = PhoneNumberFormat::E164;
        }

        return $phoneUtil->format($phoneParse, $method);
    }
394012
public function country(string $country): string
    {
        if (!Configure::read('countries')) {
            Configure::load('CkTools.countries');
        }
        $countries = Configure::read('countries');

        return $countries[$country] ?? $country;
    }
1099049
public function setCountry(\Core\Entity\Country $country = null)
    {
        $this->country = $country;

        return $this;
    }
1143754
public static function validate($phoneNumber, $country = null)
    {
        $phoneNumber = trim($phoneNumber);
        if (empty($phoneNumber)) {
            return false;
        }
        $country = strtoupper($country);
        $phoneUtil = PhoneNumberUtil::getInstance();
        try {
            $numberProto = $phoneUtil->parse($phoneNumber, $country);
        } catch (NumberParseException $e) {
            return false;
        }

        return $phoneUtil->isValidNumber($numberProto);
    }
499901
public function setPhone($areaCode, $number, $countryCode = 55)
    {
        $this->data->person->phone = new stdClass();
        $this->data->person->phone->countryCode = $countryCode;
        $this->data->person->phone->areaCode = $areaCode;
        $this->data->person->phone->number = $number;

        return $this;
    }
736346
protected function setCountry($code)
    {
        $this->data_country = $this->country->get($code);

        if (empty($this->data_country)) {
            $this->outputHttpStatus(404);
        }
    }
1093380
public function setCountryId($countryid)
	{
		if ( $countryid === $this->getCountryId() ) { return; }

		$this->_values['countryid'] = strtoupper( (string) $countryid );
		$this->setModified();
	}
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']);
    }
223036
public function setCountry(\Tx_Oelib_Model_Country $country = null)
    {
        $countryCode = ($country !== null) ? $country->getIsoAlpha3Code() : '';

        $this->setAsString('static_info_country', $countryCode);
    }
1285237
public function setCountry($country)
    {
        if(strlen($country) > 2) {
            $country = CountryCodes::getCodeByName($country);
        }

        if(!CountryCodes::isValid($country)) {
            /*
             * @todo create Exception class for InvalidCountry
             */
            throw new \Exception('Invalid country specified in '. get_class($this));
        }
        $this->setCountryCode($country);

        return $this;
    }
878899
public function setCountry($country) {
        if (empty($country))
            throw new Exception('Country must be set and cannot be empty.');

        $this->country = trim($country);

        return $this;
    }
488637
public function addCountry($country)
    {
        if (!in_array($country, $this->countries)) {
            $this->countries[] = $country;
        }

        return $this;
    }
1022919
public function formatForMobileDialingInCountry($country, $removeFormatting = false)
    {
        if (! static::isValidCountryCode($country)) {
            throw CountryCodeException::invalid($country);
        }

        return $this->lib->formatNumberForMobileDialing(
            $this->getPhoneNumberInstance(),
            $country,
            $removeFormatting
        );
    }
997744
public function setCode($v)
    {
        if ($v !== null) {
            $v = (string) $v;
        }

        if ($this->code !== $v) {
            $this->code = $v;
            $this->modifiedColumns[] = CountryPeer::CODE;
        }


        return $this;
    }