You are here

public function Account::getPreferredLangcode in Service Container 7

Same name and namespace in other branches
  1. 7.2 src/Session/Account.php \Drupal\service_container\Session\Account::getPreferredLangcode()

Returns the preferred language code of the account.

Parameters

bool $fallback_to_default: (optional) Whether the return value will fall back to the site default language if the user has no language preference.

Return value

string The language code that is preferred by the account. If the preferred language is not set or is a language not configured anymore on the site, the site default is returned or an empty string is returned (if $fallback_to_default is FALSE).

Overrides AccountInterface::getPreferredLangcode

File

src/Session/Account.php, line 113
Contains \Drupal\service_container\Session\Account.

Class

Account
Wraps the global user to provide the account interface.

Namespace

Drupal\service_container\Session

Code

public function getPreferredLangcode($fallback_to_default = TRUE) {
  throw new \BadMethodCallException(sprintf('%s is not implemented', __FUNCTION__));
}