You are here

public function CouponGenerateForm::__construct in Commerce Core 8.2

Constructs a new CouponGenerateForm object.

Parameters

\Drupal\commerce_promotion\CouponCodeGeneratorInterface $coupon_code_generator: The coupon code generator.

\Drupal\Core\Routing\CurrentRouteMatch $current_route_match: The current route match.

File

modules/promotion/src/Form/CouponGenerateForm.php, line 54

Class

CouponGenerateForm
Provides a form for bulk generating coupons.

Namespace

Drupal\commerce_promotion\Form

Code

public function __construct(CouponCodeGeneratorInterface $coupon_code_generator, CurrentRouteMatch $current_route_match) {
  $this->couponCodeGenerator = $coupon_code_generator;
  $this->promotion = $current_route_match
    ->getParameter('commerce_promotion');
}