final class Country in Price 3.x
Same name and namespace in other branches
- 8 src/Country.php \Drupal\price\Country
- 2.0.x src/Country.php \Drupal\price\Country
- 2.x src/Country.php \Drupal\price\Country
- 3.0.x src/Country.php \Drupal\price\Country
Represents a country.
Hierarchy
- class \Drupal\price\Country
Expanded class hierarchy of Country
1 file declares its use of Country
- DefaultCountryResolver.php in src/
Resolver/ DefaultCountryResolver.php
1 string reference to 'Country'
- CountryCacheContext::getLabel in src/
Cache/ Context/ CountryCacheContext.php - Returns the label of the cache context.
File
- src/
Country.php, line 8
Namespace
Drupal\priceView source
final class Country {
/**
* Two-letter country code.
*
* @var string
*/
protected $countryCode;
/**
* Constructs a new Country object.
*
* @param string $country_code
* The country code.
*/
public function __construct($country_code) {
$this->countryCode = strtoupper($country_code);
}
/**
* Gets the country code.
*
* @return string
* The country code.
*/
public function getCountryCode() {
return $this->countryCode;
}
/**
* Gets the string representation of the country.
*
* @return string
* The string representation of the country
*/
public function __toString() {
return $this->countryCode;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
Country:: |
protected | property | Two-letter country code. | |
Country:: |
public | function | Gets the country code. | |
Country:: |
public | function | Constructs a new Country object. | |
Country:: |
public | function | Gets the string representation of the country. |