You are here

public function CurrentCountry::__construct in Price 2.0.x

Same name and namespace in other branches
  1. 8 src/CurrentCountry.php \Drupal\price\CurrentCountry::__construct()
  2. 3.x src/CurrentCountry.php \Drupal\price\CurrentCountry::__construct()
  3. 2.x src/CurrentCountry.php \Drupal\price\CurrentCountry::__construct()
  4. 3.0.x src/CurrentCountry.php \Drupal\price\CurrentCountry::__construct()

Constructs a new CurrentCountry object.

Parameters

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

\Drupal\price\Resolver\ChainCountryResolverInterface $chain_resolver: The chain resolver.

File

src/CurrentCountry.php, line 50

Class

CurrentCountry
Holds a reference to the current country, resolved on demand.

Namespace

Drupal\price

Code

public function __construct(RequestStack $request_stack, ChainCountryResolverInterface $chain_resolver) {
  $this->requestStack = $request_stack;
  $this->chainResolver = $chain_resolver;
  $this->countries = new \SplObjectStorage();
}