function Locale::config

Same name in other branches
  1. 9 core/modules/locale/src/Locale.php \Drupal\locale\Locale::config()
  2. 8.9.x core/modules/locale/src/Locale.php \Drupal\locale\Locale::config()
  3. 11.x core/modules/locale/src/Locale.php \Drupal\locale\Locale::config()

Returns the locale configuration manager service.

Use the locale config manager service for creating locale-wrapped typed configuration objects.

Return value

\Drupal\locale\LocaleConfigManager The locale configuration manager.

Deprecated

in drupal:10.3.0 and is removed from drupal:11.0.0. Use \Drupal::service('locale.config_manager') instead.

See also

https://www.drupal.org/node/3437110

1 call to Locale::config()
LocaleTest::testConfig in core/modules/locale/tests/src/Unit/LocaleTest.php
Tests deprecation of config() method.

File

core/modules/locale/src/Locale.php, line 31

Class

Locale
Static service container wrapper for locale.

Namespace

Drupal\locale

Code

public static function config() {
    @trigger_error(__METHOD__ . '() is deprecated in drupal:10.3.0 and is removed from drupal:11.0.0. Use \\Drupal::service(\'locale.config_manager\') instead. See https://www.drupal.org/node/3437110', E_USER_DEPRECATED);
    return \Drupal::service('locale.config_manager');
}

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