class MinQtyLessThanOrEqualMaxQtyConstraint in Commerce Product Bundle 8
Helps validating that the minimum qty value is less than or equal to the maximum qty.
Plugin annotation
@Constraint(
id = "MinQtyLessThanOrEqualMaxQty",
label = @Translation("Checks that minimum quantity is less or equal than maximum quantity.", context = "Validation"),
type = "entity:product_bundle_item"
)
Hierarchy
- class \Drupal\Core\Entity\Plugin\Validation\Constraint\CompositeConstraintBase extends \Symfony\Component\Validator\Constraint
- class \Drupal\commerce_product_bundle\Plugin\Validation\Constraint\MinQtyLessThanOrEqualMaxQtyConstraint
Expanded class hierarchy of MinQtyLessThanOrEqualMaxQtyConstraint
1 file declares its use of MinQtyLessThanOrEqualMaxQtyConstraint
- MinQtyLessThanOrEqualMaxQtyConstraintValidatorTest.php in tests/
src/ Unit/ Plugin/ Validation/ Constraint/ MinQtyLessThanOrEqualMaxQtyConstraintValidatorTest.php
File
- src/
Plugin/ Validation/ Constraint/ MinQtyLessThanOrEqualMaxQtyConstraint.php, line 16
Namespace
Drupal\commerce_product_bundle\Plugin\Validation\ConstraintView source
class MinQtyLessThanOrEqualMaxQtyConstraint extends CompositeConstraintBase {
/**
* Message that will be shown if validation fails.
*
* @var string
*/
public $message = 'Minimum Quantity (%min) must be less than or equal to Maximum Quantity (%max).';
/**
* @inheritdoc
*/
public function coversFields() {
return [
'min_quantity',
'max_quantity',
];
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
MinQtyLessThanOrEqualMaxQtyConstraint:: |
public | property | Message that will be shown if validation fails. | |
MinQtyLessThanOrEqualMaxQtyConstraint:: |
public | function |
@inheritdoc Overrides CompositeConstraintBase:: |