public ContentEntityBase::language()
Gets the language of the entity.
\Drupal\Core\Language\LanguageInterface The language object.
Overrides Entity::language
public function language() { $language = NULL; if ($this->activeLangcode != LanguageInterface::LANGCODE_DEFAULT) { if (!isset($this->languages[$this->activeLangcode])) { $this->getLanguages(); } $language = $this->languages[$this->activeLangcode]; } else { // @todo Avoid this check by getting the language from the language // manager directly in https://www.drupal.org/node/2303877. if (!isset($this->languages[$this->defaultLangcode])) { $this->getLanguages(); } $language = $this->languages[$this->defaultLangcode]; } return $language; }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Entity!ContentEntityBase.php/function/ContentEntityBase::language/8.1.x