public function AddToCartController::__construct in Commerce Add To Cart Link 8
Same name and namespace in other branches
- 2.x src/Controller/AddToCartController.php \Drupal\commerce_add_to_cart_link\Controller\AddToCartController::__construct()
Constructs a new AddToCartController object.
Parameters
\Drupal\commerce_add_to_cart_link\CartLinkTokenInterface $cart_link_token: The cart link token service.
\Drupal\commerce_cart\CartManagerInterface $cart_manager: The cart manager.
\Drupal\commerce_cart\CartProviderInterface $cart_provider: The cart provider.
\Drupal\commerce_order\Resolver\OrderTypeResolverInterface $order_type_resolver: The order type resolver.
\Drupal\commerce_store\CurrentStoreInterface $current_store: The current store.
\Drupal\commerce_price\Resolver\ChainPriceResolverInterface $chain_price_resolver: The chain base price resolver.
\Drupal\Core\Session\AccountInterface $current_user: The current user.
File
- src/
Controller/ AddToCartController.php, line 94
Class
- AddToCartController
- Defines the add to cart controller.
Namespace
Drupal\commerce_add_to_cart_link\ControllerCode
public function __construct(CartLinkTokenInterface $cart_link_token, CartManagerInterface $cart_manager, CartProviderInterface $cart_provider, OrderTypeResolverInterface $order_type_resolver, CurrentStoreInterface $current_store, ChainPriceResolverInterface $chain_price_resolver, AccountInterface $current_user) {
$this->cartLinkToken = $cart_link_token;
$this->cartManager = $cart_manager;
$this->cartProvider = $cart_provider;
$this->orderTypeResolver = $order_type_resolver;
$this->currentStore = $current_store;
$this->chainPriceResolver = $chain_price_resolver;
$this->currentUser = $current_user;
}