You are here

public function UserInCountry::__construct in IP-based Determination of a Visitor's Country 8

Constructs a UserInCountry object.

Parameters

array $configuration: A configuration array containing information about the plugin instance.

string $plugin_id: The plugin ID for the plugin instance.

mixed $plugin_definition: The plugin implementation definition.

\Drupal\Core\Session\AccountInterface $currentUser: The current user.

\Drupal\user\UserDataInterface $userData: The user.data service.

\Drupal\Core\Locale\CountryManagerInterface $countryManager: The core country_manager service.

\Drupal\ip2country\Ip2CountryLookupInterface $ip2countryLookup: The Ip2Country lookup service manager.

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

Overrides ConditionPluginBase::__construct

File

src/Plugin/Condition/UserInCountry.php, line 90

Class

UserInCountry
Provides a 'User is in country' condition.

Namespace

Drupal\ip2country\Plugin\Condition

Code

public function __construct(array $configuration, $plugin_id, $plugin_definition, AccountInterface $currentUser, UserDataInterface $userData, CountryManagerInterface $countryManager, Ip2CountryLookupInterface $ip2countryLookup, RequestStack $requestStack) {
  parent::__construct($configuration, $plugin_id, $plugin_definition);
  $this->currentUser = $currentUser;
  $this->userData = $userData;
  $this->countryManager = $countryManager;
  $this->ip2countryLookup = $ip2countryLookup;
  $this->requestStack = $requestStack;
}