class AllowedValuesConstraint
Same name in other branches
- 8.9.x core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint/AllowedValuesConstraint.php \Drupal\Core\Validation\Plugin\Validation\Constraint\AllowedValuesConstraint
- 10 core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint/AllowedValuesConstraint.php \Drupal\Core\Validation\Plugin\Validation\Constraint\AllowedValuesConstraint
- 11.x core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint/AllowedValuesConstraint.php \Drupal\Core\Validation\Plugin\Validation\Constraint\AllowedValuesConstraint
Checks for the value being allowed.
Plugin annotation
@Constraint(
id = "AllowedValues",
label = @Translation("Allowed values", context = "Validation")
)
Hierarchy
- class \Drupal\Core\Validation\Plugin\Validation\Constraint\AllowedValuesConstraint extends \Symfony\Component\Validator\Constraints\Choice
Expanded class hierarchy of AllowedValuesConstraint
See also
\Drupal\Core\TypedData\OptionsProviderInterface
1 file declares its use of AllowedValuesConstraint
- EntityReferenceItem.php in core/
lib/ Drupal/ Core/ Field/ Plugin/ Field/ FieldType/ EntityReferenceItem.php
File
-
core/
lib/ Drupal/ Core/ Validation/ Plugin/ Validation/ Constraint/ AllowedValuesConstraint.php, line 17
Namespace
Drupal\Core\Validation\Plugin\Validation\ConstraintView source
class AllowedValuesConstraint extends Choice {
public $strict = TRUE;
public $minMessage = 'You must select at least %limit choice.|You must select at least %limit choices.';
public $maxMessage = 'You must select at most %limit choice.|You must select at most %limit choices.';
}
Members
Title Sort descending | Modifiers | Object type | Summary |
---|---|---|---|
AllowedValuesConstraint::$maxMessage | public | property | |
AllowedValuesConstraint::$minMessage | public | property | |
AllowedValuesConstraint::$strict | public | property |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.