function LanguageNegotiationContentEntity::getLangcode
Same name in other branches
- 9 core/modules/language/src/Plugin/LanguageNegotiation/LanguageNegotiationContentEntity.php \Drupal\language\Plugin\LanguageNegotiation\LanguageNegotiationContentEntity::getLangcode()
- 8.9.x core/modules/language/src/Plugin/LanguageNegotiation/LanguageNegotiationContentEntity.php \Drupal\language\Plugin\LanguageNegotiation\LanguageNegotiationContentEntity::getLangcode()
- 11.x core/modules/language/src/Plugin/LanguageNegotiation/LanguageNegotiationContentEntity.php \Drupal\language\Plugin\LanguageNegotiation\LanguageNegotiationContentEntity::getLangcode()
Overrides LanguageNegotiationMethodInterface::getLangcode
1 call to LanguageNegotiationContentEntity::getLangcode()
- LanguageNegotiationContentEntity::processOutbound in core/
modules/ language/ src/ Plugin/ LanguageNegotiation/ LanguageNegotiationContentEntity.php
File
-
core/
modules/ language/ src/ Plugin/ LanguageNegotiation/ LanguageNegotiationContentEntity.php, line 94
Class
- LanguageNegotiationContentEntity
- Class for identifying the content translation language.
Namespace
Drupal\language\Plugin\LanguageNegotiationCode
public function getLangcode(?Request $request = NULL) {
if ($request === NULL || $this->languageManager === NULL) {
return NULL;
}
$langcode = $request->query
->get(static::QUERY_PARAMETER);
$language_enabled = array_key_exists($langcode, $this->languageManager
->getLanguages());
return $language_enabled ? $langcode : NULL;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.