You are here

class LanguageCookieFixedNegotiation in Language Cookie 8

Class for identifying language from a selected language.

Plugin annotation


@LanguageNegotiation(
  id = \Drupal\language_cookie_test\Plugin\LanguageNegotiation\LanguageCookieFixedNegotiation::METHOD_ID,
  weight = 10,
  name = @Translation("Test language cookie negotiation"),
  description = @Translation("This is a test negotiation for language cookie."),
  types = {Drupal\Core\Language\LanguageInterface::TYPE_INTERFACE}
)

Hierarchy

Expanded class hierarchy of LanguageCookieFixedNegotiation

2 files declare their use of LanguageCookieFixedNegotiation
LanguageCookieLanguageSelectionPageTest.php in tests/src/Functional/LanguageCookieLanguageSelectionPageTest.php
LanguageCookieTestBase.php in tests/src/Functional/LanguageCookieTestBase.php

File

tests/modules/language_cookie_test/src/Plugin/LanguageNegotiation/LanguageCookieFixedNegotiation.php, line 19

Namespace

Drupal\language_cookie_test\Plugin\LanguageNegotiation
View source
class LanguageCookieFixedNegotiation extends LanguageNegotiationMethodBase {

  /**
   * The language negotiation method id.
   */
  const METHOD_ID = 'test-language-cookie-fixed-negotiation';

  /**
   * {@inheritdoc}
   */
  public function getLangcode(Request $request = NULL) {
    return 'nl';
  }

}

Members

Namesort descending Modifiers Type Description Overrides
LanguageCookieFixedNegotiation::getLangcode public function Performs language negotiation. Overrides LanguageNegotiationMethodInterface::getLangcode
LanguageCookieFixedNegotiation::METHOD_ID constant The language negotiation method id.
LanguageNegotiationMethodBase::$config protected property The configuration factory.
LanguageNegotiationMethodBase::$currentUser protected property The current active user.
LanguageNegotiationMethodBase::$languageManager protected property The language manager.
LanguageNegotiationMethodBase::persist public function Notifies the plugin that the language code it returned has been accepted. Overrides LanguageNegotiationMethodInterface::persist 1
LanguageNegotiationMethodBase::setConfig public function Injects the configuration factory. Overrides LanguageNegotiationMethodInterface::setConfig
LanguageNegotiationMethodBase::setCurrentUser public function Injects the current user. Overrides LanguageNegotiationMethodInterface::setCurrentUser
LanguageNegotiationMethodBase::setLanguageManager public function Injects the language manager. Overrides LanguageNegotiationMethodInterface::setLanguageManager