DefaultLanguageItem::getDefaultLangcode

public DefaultLanguageItem::getDefaultLangcode(EntityInterface $entity)

Provides default language code of given entity.

Parameters

\Drupal\Core\Entity\EntityInterface $entity: The entity whose language code to be loaded.

Return value

string A string language code.

File

core/modules/language/src/DefaultLanguageItem.php, line 45

Class

DefaultLanguageItem
Alternative plugin implementation of the 'language' field type.

Namespace

Drupal\language

Code

public function getDefaultLangcode(EntityInterface $entity) {
  return language_get_default_langcode($entity->getEntityTypeId(), $entity->bundle());
}
doc_Drupal
2016-10-29 09:01:47
Comments
Leave a Comment

Please login to continue.