private function ContentTranslationAccessCheck::getTargetLanguage in Allowed Languages 2.x
Same name and namespace in other branches
- 8 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 97
Class
- ContentTranslationAccessCheck
- Allowed languages content translation access check.
Namespace
Drupal\allowed_languages\AccessCode
private function getTargetLanguage($target) {
return $this->languageManager
->getLanguage($target) ?: $this->languageManager
->getCurrentLanguage(LanguageInterface::TYPE_CONTENT);
}