You are here

public function CurrencyLocale::getCountryCode in Currency 8.3

Gets the country code.

Return value

string

Overrides CurrencyLocaleInterface::getCountryCode

1 call to CurrencyLocale::getCountryCode()
CurrencyLocale::label in src/Entity/CurrencyLocale.php
Gets the label of the entity.

File

src/Entity/CurrencyLocale.php, line 192

Class

CurrencyLocale
Defines a currency locale entity.

Namespace

Drupal\currency\Entity

Code

public function getCountryCode() {
  if ($this
    ->id()) {
    $fragments = explode('_', $this
      ->id());
    return $fragments[1];
  }
}