You are here

public function CurrencyLocale::getLanguageCode in Currency 8.3

Gets the language code.

Return value

string

Overrides CurrencyLocaleInterface::getLanguageCode

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

File

src/Entity/CurrencyLocale.php, line 182

Class

CurrencyLocale
Defines a currency locale entity.

Namespace

Drupal\currency\Entity

Code

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