You are here

public function CartLinkToken::__construct in Commerce Add To Cart Link 8

Same name and namespace in other branches
  1. 2.x src/CartLinkToken.php \Drupal\commerce_add_to_cart_link\CartLinkToken::__construct()

Constructs a new CartLinkToken object.

Parameters

\Drupal\Core\Access\CsrfTokenGenerator $csrf_token_generator: The CSRF token generator.

\Drupal\Core\Session\AccountInterface $current_user: The current user.

\Symfony\Component\HttpFoundation\Session\Session $session: The request stack.

\Drupal\Core\Config\ConfigFactoryInterface $config_factory: The config factory.

File

src/CartLinkToken.php, line 56

Class

CartLinkToken
Default cart link token service implementation.

Namespace

Drupal\commerce_add_to_cart_link

Code

public function __construct(CsrfTokenGenerator $csrf_token_generator, AccountInterface $current_user, Session $session, ConfigFactoryInterface $config_factory) {
  $this->config = $config_factory
    ->get('commerce_add_to_cart_link.settings');
  $this->csrfTokenGenerator = $csrf_token_generator;
  $this->currentUser = $current_user;
  $this->session = $session;
}