You are here

public function OrderEventSubscriber::__construct in Commerce Core 8.2

Same name in this branch
  1. 8.2 modules/log/src/EventSubscriber/OrderEventSubscriber.php \Drupal\commerce_log\EventSubscriber\OrderEventSubscriber::__construct()
  2. 8.2 modules/cart/src/EventSubscriber/OrderEventSubscriber.php \Drupal\commerce_cart\EventSubscriber\OrderEventSubscriber::__construct()
  3. 8.2 modules/promotion/src/EventSubscriber/OrderEventSubscriber.php \Drupal\commerce_promotion\EventSubscriber\OrderEventSubscriber::__construct()

Constructs a new OrderEventSubscriber object.

Parameters

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

\Drupal\commerce_promotion\PromotionUsageInterface $usage: The promotion usage.

File

modules/promotion/src/EventSubscriber/OrderEventSubscriber.php, line 41

Class

OrderEventSubscriber

Namespace

Drupal\commerce_promotion\EventSubscriber

Code

public function __construct(EntityTypeManagerInterface $entity_type_manager, PromotionUsageInterface $usage) {
  $this->promotionStorage = $entity_type_manager
    ->getStorage('commerce_promotion');
  $this->couponStorage = $entity_type_manager
    ->getStorage('commerce_promotion_coupon');
  $this->usage = $usage;
}