You are here

public function CartTokenSubscriber::__construct in Commerce Cart API 8

Constructs a new CartTokenSubscriber object.

Parameters

\Drupal\commerce_cart\CartSessionInterface $cart_session: The cart session.

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

File

src/EventSubscriber/CartTokenSubscriber.php, line 50

Class

CartTokenSubscriber
Cart token subscriber.

Namespace

Drupal\commerce_cart_api\EventSubscriber

Code

public function __construct(CartSessionInterface $cart_session, SharedTempStoreFactory $temp_store_factory) {
  $this->cartSession = $cart_session;
  $this->tempStore = $temp_store_factory
    ->get('commerce_cart_api_tokens');
}