You are here

public function Language::__construct in Drupal 9

Same name in this branch
  1. 9 core/lib/Drupal/Core/Language/Language.php \Drupal\Core\Language\Language::__construct()
  2. 9 core/modules/language/src/Plugin/Condition/Language.php \Drupal\language\Plugin\Condition\Language::__construct()
Same name and namespace in other branches
  1. 8 core/modules/language/src/Plugin/Condition/Language.php \Drupal\language\Plugin\Condition\Language::__construct()

Creates a new Language instance.

Parameters

\Drupal\Core\Language\LanguageManagerInterface $language_manager: The language manager.

array $configuration: The plugin configuration, i.e. an array with configuration values keyed by configuration option name. The special key 'context' may be used to initialize the defined contexts by setting it to an array of context values keyed by context names.

string $plugin_id: The plugin_id for the plugin instance.

mixed $plugin_definition: The plugin implementation definition.

Overrides ConditionPluginBase::__construct

File

core/modules/language/src/Plugin/Condition/Language.php, line 47

Class

Language
Provides a 'Language' condition.

Namespace

Drupal\language\Plugin\Condition

Code

public function __construct(LanguageManagerInterface $language_manager, array $configuration, $plugin_id, $plugin_definition) {
  parent::__construct($configuration, $plugin_id, $plugin_definition);
  $this->languageManager = $language_manager;
}