You are here

class CouponCodeConstraint in Commerce Core 8.2

Ensures coupon code uniqueness.

Plugin annotation


@Constraint(
  id = "CouponCode",
  label = @Translation("Coupon code", context = "Validation")
)

Hierarchy

  • class \Drupal\Core\Validation\Plugin\Validation\Constraint\UniqueFieldConstraint extends \Symfony\Component\Validator\Constraint

Expanded class hierarchy of CouponCodeConstraint

File

modules/promotion/src/Plugin/Validation/Constraint/CouponCodeConstraint.php, line 15

Namespace

Drupal\commerce_promotion\Plugin\Validation\Constraint
View source
class CouponCodeConstraint extends UniqueFieldConstraint {
  public $message = 'The coupon code %value is already in use and must be unique.';

}

Members

Namesort descending Modifiers Type Description Overrides
CouponCodeConstraint::$message public property Overrides UniqueFieldConstraint::$message
UniqueFieldConstraint::validatedBy public function Returns the name of the class that validates this constraint.