You are here

public function WishlistProvider::__construct in Commerce Wishlist 8.3

Constructs a new WishlistProvider object.

Parameters

\Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager: The entity type manager.

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

\Drupal\commerce_wishlist\WishlistSessionInterface $wishlist_session: The wishlist session.

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

Throws

\Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException

\Drupal\Component\Plugin\Exception\PluginNotFoundException

File

src/WishlistProvider.php, line 78

Class

WishlistProvider
Default implementation of the wishlist provider.

Namespace

Drupal\commerce_wishlist

Code

public function __construct(EntityTypeManagerInterface $entity_type_manager, AccountInterface $current_user, WishlistSessionInterface $wishlist_session, ConfigFactoryInterface $config_factory) {
  $this->wishlistStorage = $entity_type_manager
    ->getStorage('commerce_wishlist');
  $this->currentUser = $current_user;
  $this->wishlistSession = $wishlist_session;
  $this->configFactory = $config_factory;
}