Length constraint.
Overrides the symfony constraint to use Drupal-style replacement patterns.
@todo: Move this below the TypedData core component.
@Plugin(
id = "Length",
label = @Translation("Length", context = "Validation"),
type = { "string" }
)
Expanded class hierarchy of LengthConstraint
class LengthConstraint extends Length {
public $maxMessage = 'This value is too long. It should have %limit character or less.|This value is too long. It should have %limit characters or less.';
public $minMessage = 'This value is too short. It should have %limit character or more.|This value is too short. It should have %limit characters or more.';
public $exactMessage = 'This value should have exactly %limit character.|This value should have exactly %limit characters.';
/**
* Overrides Range::validatedBy().
*/
public function validatedBy() {
return '\\Symfony\\Component\\Validator\\Constraints\\LengthValidator';
}
}
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
Constraint:: |
public | property | ||
Constraint:: |
public | function | Adds the given group if this constraint is in the Default group | |
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 | 12 |
Constraint:: |
public | function | Returns the name of the required options | 10 |
Constraint:: |
public | function | Returns whether the constraint can be put onto classes, properties or both | 7 |
Constraint:: |
constant | Marks a constraint that can be put onto properties | ||
Constraint:: |
public | function | Unsupported operation. | |
Length:: |
public | property | ||
Length:: |
public | property | ||
Length:: |
public | property | ||
Length:: |
public | function |
Initializes the constraint with options. Overrides Constraint:: |
|
LengthConstraint:: |
public | property |
Overrides Length:: |
|
LengthConstraint:: |
public | property |
Overrides Length:: |
|
LengthConstraint:: |
public | property |
Overrides Length:: |
|
LengthConstraint:: |
public | function |
Overrides Range::validatedBy(). Overrides Constraint:: |