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()); }
Please login to continue.