You are here

public function CurrentLocale::__construct in Price 8

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

Constructs a new CurrentLocale object.

Parameters

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

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

File

src/CurrentLocale.php, line 50

Class

CurrentLocale
Holds a reference to the current locale, resolved on demand.

Namespace

Drupal\price

Code

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