You are here

public function CouponCodeGeneratorInterface::validatePattern in Commerce Core 8.2

Validates the given pattern for the specified quantity.

Parameters

\Drupal\commerce_promotion\CouponCodePattern $pattern: The pattern.

int $quantity: The quantity.

Return value

bool TRUE if the pattern is valid, FALSE otherwise.

1 method overrides CouponCodeGeneratorInterface::validatePattern()
CouponCodeGenerator::validatePattern in modules/promotion/src/CouponCodeGenerator.php
Validates the given pattern for the specified quantity.

File

modules/promotion/src/CouponCodeGeneratorInterface.php, line 21

Class

CouponCodeGeneratorInterface
Generates coupon codes (unique, machine readable identifiers for coupons).

Namespace

Drupal\commerce_promotion

Code

public function validatePattern(CouponCodePattern $pattern, $quantity = 1);