You are here

public function EntityProcessorBase::entityLanguage in Feeds 8.3

Returns the current language for entities.

Return value

string The current language code.

Overrides EntityProcessorInterface::entityLanguage

1 call to EntityProcessorBase::entityLanguage()
EntityProcessorBase::newEntity in src/Feeds/Processor/EntityProcessorBase.php

File

src/Feeds/Processor/EntityProcessorBase.php, line 661

Class

EntityProcessorBase
Defines a base entity processor.

Namespace

Drupal\feeds\Feeds\Processor

Code

public function entityLanguage() {
  $langcodes = $this
    ->languageOptions();
  if (isset($this->configuration['langcode']) && isset($langcodes[$this->configuration['langcode']])) {
    return $this->configuration['langcode'];
  }

  // Return default language.
  return $this->languageManager
    ->getDefaultLanguage()
    ->getId();
}