You are here

abstract class LanguageNegotiationMethodBase in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/language/src/LanguageNegotiationMethodBase.php \Drupal\language\LanguageNegotiationMethodBase

Base class for language negotiation methods.

Hierarchy

Expanded class hierarchy of LanguageNegotiationMethodBase

10 files declare their use of LanguageNegotiationMethodBase
LanguageNegotiationBrowser.php in core/modules/language/src/Plugin/LanguageNegotiation/LanguageNegotiationBrowser.php
Contains \Drupal\language\Plugin\LanguageNegotiation\LanguageNegotiationBrowser.
LanguageNegotiationContentEntity.php in core/modules/language/src/Plugin/LanguageNegotiation/LanguageNegotiationContentEntity.php
Contains \Drupal\language\Plugin\LanguageNegotiation\LanguageNegotiationContentEntity.
LanguageNegotiationSelected.php in core/modules/language/src/Plugin/LanguageNegotiation/LanguageNegotiationSelected.php
Contains \Drupal\language\Plugin\LanguageNegotiation\LanguageNegotiationSelected.
LanguageNegotiationSession.php in core/modules/language/src/Plugin/LanguageNegotiation/LanguageNegotiationSession.php
Contains \Drupal\language\Plugin\LanguageNegotiation\LanguageNegotiationSession.
LanguageNegotiationTest.php in core/modules/language/tests/language_test/src/Plugin/LanguageNegotiation/LanguageNegotiationTest.php
Contains \Drupal\language_test\Plugin\LanguageNegotiation\LanguageNegotiationTest.

... See full list

File

core/modules/language/src/LanguageNegotiationMethodBase.php, line 17
Contains \Drupal\language\LanguageNegotiationMethodBase.

Namespace

Drupal\language
View source
abstract class LanguageNegotiationMethodBase implements LanguageNegotiationMethodInterface {

  /**
   * The language manager.
   *
   * @var \Drupal\Core\Language\LanguageManagerInterface
   */
  protected $languageManager;

  /**
   * The configuration factory.
   *
   * @var \Drupal\Core\Config\ConfigFactoryInterface
   */
  protected $config;

  /**
   * The current active user.
   *
   * @return \Drupal\Core\Session\AccountInterface
   */
  protected $currentUser;

  /**
   * {@inheritdoc}
   */
  public function setLanguageManager(ConfigurableLanguageManagerInterface $language_manager) {
    $this->languageManager = $language_manager;
  }

  /**
   * {@inheritdoc}
   */
  public function setConfig(ConfigFactoryInterface $config) {
    $this->config = $config;
  }

  /**
   * {@inheritdoc}
   */
  public function setCurrentUser(AccountInterface $current_user) {
    $this->currentUser = $current_user;
  }

  /**
   * {@inheritdoc}
   */
  public function persist(LanguageInterface $language) {

    // Default implementation persists nothing.
  }

}

Members

Namesort descending Modifiers Type Description Overrides
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
LanguageNegotiationMethodInterface::getLangcode public function Performs language negotiation. 10