class LanguageNegotiator in Domain Lang 8
Class responsible for performing language negotiation.
Hierarchy
- class \Drupal\language\LanguageNegotiator implements LanguageNegotiatorInterface
- class \Drupal\domain_lang\Language\LanguageNegotiator
Expanded class hierarchy of LanguageNegotiator
1 file declares its use of LanguageNegotiator
File
- src/
Language/ LanguageNegotiator.php, line 11
Namespace
Drupal\domain_lang\LanguageView source
class LanguageNegotiator extends BaseLanguageNegotiator {
/**
* {@inheritdoc}
*/
protected function getEnabledNegotiators($type) {
$domain = \Drupal::service('domain.negotiator')
->getActiveDomain();
if ($domain instanceof DomainInterface) {
return $this->configFactory
->get('domain.config.' . $domain
->id() . '.language.types')
->get('negotiation.' . $type . '.enabled') ?: [];
}
return parent::getEnabledNegotiators($type);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
LanguageNegotiator:: |
protected | property | The configuration factory. | |
LanguageNegotiator:: |
protected | property | The current active user. | |
LanguageNegotiator:: |
protected | property | The language manager. | |
LanguageNegotiator:: |
protected | property | Local cache for language negotiation method instances. | |
LanguageNegotiator:: |
protected | property | An array of language objects keyed by method id. | |
LanguageNegotiator:: |
protected | property | The language negotiation method plugin manager. | |
LanguageNegotiator:: |
protected | property | The request stack object. | |
LanguageNegotiator:: |
protected | property | The settings instance. | |
LanguageNegotiator:: |
protected | function |
Gets enabled detection methods for the provided language type. Overrides LanguageNegotiator:: |
|
LanguageNegotiator:: |
public | function |
Returns an instance of the specified language negotiation method. Overrides LanguageNegotiatorInterface:: |
|
LanguageNegotiator:: |
public | function |
Returns the language negotiation methods enabled for a language type. Overrides LanguageNegotiatorInterface:: |
|
LanguageNegotiator:: |
public | function |
Returns the ID of the language type's primary language negotiation method. Overrides LanguageNegotiatorInterface:: |
|
LanguageNegotiator:: |
public | function |
Initializes the specified language type. Overrides LanguageNegotiatorInterface:: |
|
LanguageNegotiator:: |
public | function | Initializes the injected language manager with the negotiator. | |
LanguageNegotiator:: |
public | function |
Checks whether a language negotiation method is enabled for a language type. Overrides LanguageNegotiatorInterface:: |
|
LanguageNegotiator:: |
protected | function | Performs language negotiation using the specified negotiation method. | |
LanguageNegotiator:: |
public | function |
Resave the configuration to purge missing negotiation methods. Overrides LanguageNegotiatorInterface:: |
|
LanguageNegotiator:: |
public | function |
Resets the negotiated languages and the method instances. Overrides LanguageNegotiatorInterface:: |
|
LanguageNegotiator:: |
public | function |
Saves a list of language negotiation methods for a language type. Overrides LanguageNegotiatorInterface:: |
|
LanguageNegotiator:: |
public | function |
Sets the current active user and resets all language types. Overrides LanguageNegotiatorInterface:: |
|
LanguageNegotiator:: |
public | function |
Updates the configuration based on the given language types. Overrides LanguageNegotiatorInterface:: |
|
LanguageNegotiator:: |
public | function | Constructs a new LanguageNegotiator object. | |
LanguageNegotiatorInterface:: |
constant | The language negotiation method id for the language negotiator itself. |