class AtLeastOneOfConstraint
Checks that at least one of the given constraint is satisfied.
Overrides the symfony constraint to convert the array of constraints to array of constraint objects and use them.
Attributes
#[Constraint(id: 'AtLeastOneOf', label: new TranslatableMarkup('At least one of', [], [
'context' => 'Validation',
]))]
Hierarchy
- class \Drupal\Core\Validation\Plugin\Validation\Constraint\AtLeastOneOfConstraint implements \Drupal\Core\Validation\CompositeConstraintInterface extends \Symfony\Component\Validator\Constraints\AtLeastOneOf
Expanded class hierarchy of AtLeastOneOfConstraint
1 file declares its use of AtLeastOneOfConstraint
- AtLeastOneOfConstraintValidatorTest.php in core/
tests/ Drupal/ KernelTests/ Core/ Validation/ AtLeastOneOfConstraintValidatorTest.php
File
-
core/
lib/ Drupal/ Core/ Validation/ Plugin/ Validation/ Constraint/ AtLeastOneOfConstraint.php, line 17
Namespace
Drupal\Core\Validation\Plugin\Validation\ConstraintView source
class AtLeastOneOfConstraint extends AtLeastOneOf implements CompositeConstraintInterface {
/**
* {@inheritdoc}
*/
public static function getCompositeOptionStatic() : string {
return 'constraints';
}
/**
* {@inheritdoc}
*/
public function validatedBy() : string {
return AtLeastOneOfValidator::class;
}
}
Members
| Title Sort descending | Modifiers | Object type | Summary | Overriden Title |
|---|---|---|---|---|
| AtLeastOneOfConstraint::getCompositeOptionStatic | public static | function | Returns the name of the property or properties that contain constraints. | Overrides CompositeConstraintInterface::getCompositeOptionStatic |
| AtLeastOneOfConstraint::validatedBy | public | function |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.