You are here

private function ContentTranslationAccessCheck::getTargetLanguage in Allowed Languages 8

Same name and namespace in other branches
  1. 2.x src/Access/ContentTranslationAccessCheck.php \Drupal\allowed_languages\Access\ContentTranslationAccessCheck::getTargetLanguage()

Get the target language object.

Parameters

string $target: The target language id.

Return value

\Drupal\Core\Language\LanguageInterface The target language object or the current content language.

1 call to ContentTranslationAccessCheck::getTargetLanguage()
ContentTranslationAccessCheck::access in src/Access/ContentTranslationAccessCheck.php
Check language access when managing content translations.

File

src/Access/ContentTranslationAccessCheck.php, line 104

Class

ContentTranslationAccessCheck
Allowed languages content translation access check.

Namespace

Drupal\allowed_languages\Access

Code

private function getTargetLanguage($target) {
  return $this->languageManager
    ->getLanguage($target) ?: $this->languageManager
    ->getCurrentLanguage(LanguageInterface::TYPE_CONTENT);
}