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
- class \Drupal\commerce_promotion\Plugin\Validation\Constraint\CouponCodeConstraint
Expanded class hierarchy of CouponCodeConstraint
File
- modules/
promotion/ src/ Plugin/ Validation/ Constraint/ CouponCodeConstraint.php, line 15
Namespace
Drupal\commerce_promotion\Plugin\Validation\ConstraintView source
class CouponCodeConstraint extends UniqueFieldConstraint {
public $message = 'The coupon code %value is already in use and must be unique.';
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
CouponCodeConstraint:: |
public | property |
Overrides UniqueFieldConstraint:: |
|
UniqueFieldConstraint:: |
public | function | Returns the name of the class that validates this constraint. |