You are here

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

Same name and namespace in other branches
  1. 8 modules/wishlist/src/Controller/AddToWishlistController.php \Drupal\commerce_add_to_wishlist_link\Controller\AddToWishlistController::__construct()

Constructs a new AddToWishlistController object.

Parameters

\Drupal\commerce_add_to_cart_link\CartLinkTokenInterface $cart_link_token: The cart link token service.

\Drupal\commerce_wishlist\WishlistManagerInterface $wishlist_manager: The wishlist manager.

\Drupal\commerce_wishlist\WishlistProviderInterface $wishlist_provider: The wishlist provider.

\Drupal\Core\Path\PathValidatorInterface $path_validator: The path validator.

File

modules/wishlist/src/Controller/AddToWishlistController.php, line 64

Class

AddToWishlistController
Defines the add to wishlist controller.

Namespace

Drupal\commerce_add_to_wishlist_link\Controller

Code

public function __construct(CartLinkTokenInterface $cart_link_token, WishlistManagerInterface $wishlist_manager, WishlistProviderInterface $wishlist_provider, PathValidatorInterface $path_validator) {
  $this->cartLinkToken = $cart_link_token;
  $this->wishlistManager = $wishlist_manager;
  $this->wishlistProvider = $wishlist_provider;
  $this->pathValidator = $path_validator;
}