You are here

public function CartLinkToken::__construct in Commerce Add To Cart Link 2.x

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

Constructs a new CartLinkToken object.

Parameters

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

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

\Drupal\Core\PrivateKey $private_key: The Drupal private key.

File

src/CartLinkToken.php, line 48

Class

CartLinkToken
Default cart link token service implementation.

Namespace

Drupal\commerce_add_to_cart_link

Code

public function __construct(AccountInterface $current_user, ConfigFactoryInterface $config_factory, PrivateKey $private_key) {
  $this->config = $config_factory
    ->get('commerce_add_to_cart_link.settings');
  $this->currentUser = $current_user;
  $this->privateKey = $private_key;
}