class RangeConstraint in Zircon Profile 8.0
Same name and namespace in other branches
- 8 core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint/RangeConstraint.php \Drupal\Core\Validation\Plugin\Validation\Constraint\RangeConstraint
Range constraint.
Overrides the symfony constraint to use Drupal-style replacement patterns.
@todo: Move this below the TypedData core component.
Plugin annotation
@Constraint(
id = "Range",
label = @Translation("Range", context = "Validation"),
type = { "integer", "float" }
)
Hierarchy
- class \Symfony\Component\Validator\Constraint
- class \Symfony\Component\Validator\Constraints\Range
- class \Drupal\Core\Validation\Plugin\Validation\Constraint\RangeConstraint
- class \Symfony\Component\Validator\Constraints\Range
Expanded class hierarchy of RangeConstraint
File
- core/
lib/ Drupal/ Core/ Validation/ Plugin/ Validation/ Constraint/ RangeConstraint.php, line 25 - Contains \Drupal\Core\Validation\Plugin\Validation\Constraint\RangeConstraint.
Namespace
Drupal\Core\Validation\Plugin\Validation\ConstraintView source
class RangeConstraint extends Range {
public $minMessage = 'This value should be %limit or more.';
public $maxMessage = 'This value should be %limit or less.';
/**
* {@inheritdoc}
*/
public function validatedBy() {
return '\\Symfony\\Component\\Validator\\Constraints\\RangeValidator';
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
Constraint:: |
public | property | Domain-specific data attached to a constraint. | |
Constraint:: |
public | function | Adds the given group if this constraint is in the Default group. | 1 |
Constraint:: |
constant | Marks a constraint that can be put onto classes. | ||
Constraint:: |
constant | The name of the group given to all constraints with no explicit group. | ||
Constraint:: |
public | function | Returns the name of the default option. | 18 |
Constraint:: |
public static | function | Returns the name of the given error code. | |
Constraint:: |
public | function | Returns the name of the required options. | 11 |
Constraint:: |
public | function | Returns whether the constraint can be put onto classes, properties or both. | 11 |
Constraint:: |
constant | Marks a constraint that can be put onto properties. | ||
Constraint:: |
public | function | Returns the value of a lazily initialized option. | 1 |
Constraint:: |
public | function | Sets the value of a lazily initialized option. | 1 |
Constraint:: |
public | function | Optimizes the serialized value to minimize storage space. | |
Range:: |
protected static | property |
Maps error codes to the names of their constants. Overrides Constraint:: |
|
Range:: |
public | property | ||
Range:: |
public | property | ||
Range:: |
public | property | ||
Range:: |
constant | |||
Range:: |
constant | |||
Range:: |
constant | |||
Range:: |
public | function |
Initializes the constraint with options. Overrides Constraint:: |
|
RangeConstraint:: |
public | property |
Overrides Range:: |
|
RangeConstraint:: |
public | property |
Overrides Range:: |
|
RangeConstraint:: |
public | function |
Returns the name of the class that validates this constraint. Overrides Constraint:: |