You are here

abstract class CompositeConstraintBase in Drupal 9

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Entity/Plugin/Validation/Constraint/CompositeConstraintBase.php \Drupal\Core\Entity\Plugin\Validation\Constraint\CompositeConstraintBase

Provides a base class for constraints validating multiple fields.

The constraint must be defined on entity-level; i.e., added to the entity type.

Hierarchy

  • class \Drupal\Core\Entity\Plugin\Validation\Constraint\CompositeConstraintBase extends \Symfony\Component\Validator\Constraint

Expanded class hierarchy of CompositeConstraintBase

See also

\Drupal\Core\Entity\EntityType::addConstraint

6 files declare their use of CompositeConstraintBase
CommentNameConstraint.php in core/modules/comment/src/Plugin/Validation/Constraint/CommentNameConstraint.php
EntityConstraintViolationList.php in core/lib/Drupal/Core/Entity/EntityConstraintViolationList.php
EntityTestCompositeConstraint.php in core/modules/system/tests/modules/entity_test/src/Plugin/Validation/Constraint/EntityTestCompositeConstraint.php
EntityValidationTest.php in core/tests/Drupal/KernelTests/Core/Entity/EntityValidationTest.php
MenuTreeHierarchyConstraint.php in core/modules/menu_link_content/src/Plugin/Validation/Constraint/MenuTreeHierarchyConstraint.php

... See full list

File

core/lib/Drupal/Core/Entity/Plugin/Validation/Constraint/CompositeConstraintBase.php, line 15

Namespace

Drupal\Core\Entity\Plugin\Validation\Constraint
View source
abstract class CompositeConstraintBase extends Constraint {

  /**
   * An array of entity fields which should be passed to the validator.
   *
   * @return string[]
   *   An array of field names.
   */
  public abstract function coversFields();

}

Members

Namesort descending Modifiers Type Description Overrides
CompositeConstraintBase::coversFields abstract public function An array of entity fields which should be passed to the validator. 4