abstract class LanguageNegotiationMethodBase implements LanguageNegotiationMethodInterface (View source)

Base class for language negotiation methods.

Properties

protected LanguageManagerInterface $languageManager

The language manager.

protected ConfigFactoryInterface $config

The configuration factory.

protected AccountInterface $currentUser

The current active user.

Methods

setLanguageManager(ConfigurableLanguageManagerInterface $language_manager)

Injects the language manager.

setConfig(ConfigFactoryInterface $config)

Injects the configuration factory.

setCurrentUser(AccountInterface $current_user)

Injects the current user.

persist(LanguageInterface $language)

Notifies the plugin that the language code it returned has been accepted.

Details

setLanguageManager(ConfigurableLanguageManagerInterface $language_manager)

Injects the language manager.

Parameters

ConfigurableLanguageManagerInterface $language_manager

The language manager to be used to retrieve the language list and the already negotiated languages.

setConfig(ConfigFactoryInterface $config)

Injects the configuration factory.

Parameters

ConfigFactoryInterface $config

The configuration factory.

setCurrentUser(AccountInterface $current_user)

Injects the current user.

Parameters

AccountInterface $current_user

The current active user.

persist(LanguageInterface $language)

Notifies the plugin that the language code it returned has been accepted.

Parameters

LanguageInterface $language

The accepted language.