CompositeConstraintBase.php 585 B

12345678910111213141516171819202122232425
  1. <?php
  2. namespace Drupal\Core\Entity\Plugin\Validation\Constraint;
  3. use Symfony\Component\Validator\Constraint;
  4. /**
  5. * Provides a base class for constraints validating multiple fields.
  6. *
  7. * The constraint must be defined on entity-level; i.e., added to the entity
  8. * type.
  9. *
  10. * @see \Drupal\Core\Entity\EntityType::addConstraint
  11. */
  12. abstract class CompositeConstraintBase extends Constraint {
  13. /**
  14. * An array of entity fields which should be passed to the validator.
  15. *
  16. * @return string[]
  17. * An array of field names.
  18. */
  19. abstract public function coversFields();
  20. }