function Drupal::languageManager

Same name in other branches
  1. 9 core/lib/Drupal.php \Drupal::languageManager()
  2. 10 core/lib/Drupal.php \Drupal::languageManager()
  3. 11.x core/lib/Drupal.php \Drupal::languageManager()

Returns the language manager service.

Return value

\Drupal\Core\Language\LanguageManagerInterface The language manager.

14 calls to Drupal::languageManager()
ConfigurableLanguage::postDelete in core/modules/language/src/Entity/ConfigurableLanguage.php
Acts on deleted entities before the delete hook is invoked.
ConfigurableLanguage::postSave in core/modules/language/src/Entity/ConfigurableLanguage.php
Acts on a saved entity before the insert or update hook is invoked.
DrupalTest::testLanguageManager in core/tests/Drupal/Tests/Core/DrupalTest.php
Tests the languageManager() method.
EntityBase::languageManager in core/lib/Drupal/Core/Entity/EntityBase.php
Gets the language manager.
InstallerTranslationMultipleLanguageTest::testTranslationsLoaded in core/tests/Drupal/FunctionalTests/Installer/InstallerTranslationMultipleLanguageTest.php
Tests that translations ended up at the expected places.

... See full list

File

core/lib/Drupal.php, line 646

Class

Drupal
Static Service Container wrapper.

Code

public static function languageManager() {
    return static::getContainer()->get('language_manager');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.