You are here

public function Language::__construct in GoogleTagManager 8

Constructs a language condition plugin.

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 ConditionBase::__construct

File

src/Plugin/Condition/Language.php, line 47

Class

Language
Provides a 'Language' condition.

Namespace

Drupal\google_tag\Plugin\Condition

Code

public function __construct(LanguageManagerInterface $language_manager, array $configuration, $plugin_id, $plugin_definition) {
  $this->toggle = 'language_toggle';
  $this->list = 'language_list';
  $this->singular = 'language';
  $this->plural = 'languages';
  parent::__construct($configuration, $plugin_id, $plugin_definition);
  $this->languageManager = $language_manager;
  $this->options = $this
    ->languageOptions();
}