You are here

public function BlockCountry::__construct in Block Country 8

Creates a new BlockCountry instance.

Parameters

\Drupal\Core\Locale\CountryManagerInterface $country_manager: The country manager.

\Symfony\Component\HttpFoundation\RequestStack $request_stack: The request stack.

\Drupal\ip2country\Ip2CountryLookup $ip2_country_lookup: The IP2Country Lookup service.

array $configuration: The plugin configuration.

string $plugin_id: The plugin_id for the plugin instance.

mixed $plugin_definition: The plugin implementation definition.

Overrides ConditionPluginBase::__construct

File

src/Plugin/Condition/BlockCountry.php, line 61

Class

BlockCountry
Provides a 'Country' condition.

Namespace

Drupal\block_country\Plugin\Condition

Code

public function __construct(CountryManagerInterface $country_manager, RequestStack $request_stack, Ip2CountryLookup $ip2_country_lookup, array $configuration, $plugin_id, $plugin_definition) {
  parent::__construct($configuration, $plugin_id, $plugin_definition);
  $this->countryManager = $country_manager;
  $this->requestStack = $request_stack;
  $this->ip2CountryLookUp = $ip2_country_lookup;
}