You are here

public function CartTokenSession::__construct in Commerce Cart API 8

Constructs a new CartTokenSession object.

Parameters

\Drupal\commerce_cart\CartSessionInterface $inner: The decorated cart session.

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

\Drupal\Core\TempStore\SharedTempStoreFactory $temp_store_factory: The temp store factory.

File

src/CartTokenSession.php, line 49

Class

CartTokenSession
Decorates the cart session to support cart tokens.

Namespace

Drupal\commerce_cart_api

Code

public function __construct(CartSessionInterface $inner, RequestStack $request_stack, SharedTempStoreFactory $temp_store_factory) {
  $this->inner = $inner;
  $this->requestStack = $request_stack;
  $this->tempStore = $temp_store_factory
    ->get('commerce_cart_api_tokens');
}