You are here

public function CartManager::__construct in Commerce Core 8.2

Constructs a new CartManager object.

Parameters

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

\Drupal\commerce_cart\OrderItemMatcherInterface $order_item_matcher: The order item matcher.

\Symfony\Component\EventDispatcher\EventDispatcherInterface $event_dispatcher: The event dispatcher.

File

modules/cart/src/CartManager.php, line 57

Class

CartManager
Default implementation of the cart manager.

Namespace

Drupal\commerce_cart

Code

public function __construct(EntityTypeManagerInterface $entity_type_manager, OrderItemMatcherInterface $order_item_matcher, EventDispatcherInterface $event_dispatcher) {
  $this->orderItemStorage = $entity_type_manager
    ->getStorage('commerce_order_item');
  $this->orderItemMatcher = $order_item_matcher;
  $this->eventDispatcher = $event_dispatcher;
}