public function ContentEntitySource::getSourceLangCode

Gets language code of the job item source.

Parameters

\Drupal\tmgmt\JobItemInterface $job_item: The job item.

Return value

string|false Language code or FALSE for unknown.

Overrides SourcePluginInterface::getSourceLangCode

File

sources/content/src/Plugin/tmgmt/Source/ContentEntitySource.php, line 457

Class

ContentEntitySource
Content entity source plugin controller.

Namespace

Drupal\tmgmt_content\Plugin\tmgmt\Source

Code

public function getSourceLangCode(JobItemInterface $job_item) {
  if (!($entity = $this
    ->getEntity($job_item))) {
    return FALSE;
  }
  return $entity
    ->getUntranslated()
    ->language()
    ->getId();
}