You are here

public function ExampleMultilingualField::getLangcode in Extra Field 8.2

Same name and namespace in other branches
  1. 8 modules/extra_field_example/src/Plugin/ExtraField/Display/ExampleMultilingualField.php \Drupal\extra_field_example\Plugin\ExtraField\Display\ExampleMultilingualField::getLangcode()

Gets the langcode of the field values.

Return value

string The langcode.

Overrides ExtraFieldDisplayFormattedBase::getLangcode

File

modules/extra_field_example/src/Plugin/ExtraField/Display/ExampleMultilingualField.php, line 89

Class

ExampleMultilingualField
Example Extra field Display.

Namespace

Drupal\extra_field_example\Plugin\ExtraField\Display

Code

public function getLangcode() {
  if ($tagsField = $this
    ->getTagsField()) {
    $langcode = $tagsField
      ->getLangcode();
  }
  else {
    $langcode = parent::getLangcode();
  }
  return $langcode;
}