You are here

public function CurrentLocale::__construct in Commerce Core 8.2

Constructs a new CurrentLocale object.

Parameters

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

\Drupal\commerce\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\commerce

Code

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