public function RangeConstraint::__construct in Drupal 10
File
- core/
lib/ Drupal/ Core/ Validation/ Plugin/ Validation/ Constraint/ RangeConstraint.php, line 25
Class
- RangeConstraint
- Range constraint.
Namespace
Drupal\Core\Validation\Plugin\Validation\ConstraintCode
public function __construct(array $options = NULL) {
if (isset($options['min']) && isset($options['max'])) {
$options['notInRangeMessage'] = $options['notInRangeMessage'] ?? 'This value should be between %min and %max.';
}
else {
$options['minMessage'] = $options['minMessage'] ?? 'This value should be %limit or more.';
$options['maxMessage'] = $options['maxMessage'] ?? 'This value should be %limit or less.';
}
parent::__construct($options);
}