class EntityTestCompositeConstraint

Same name in this branch
  1. 9 core/modules/system/tests/modules/entity_test/src/Entity/EntityTestCompositeConstraint.php \Drupal\entity_test\Entity\EntityTestCompositeConstraint
Same name and namespace in other branches
  1. 11.x core/modules/system/tests/modules/entity_test/src/Entity/EntityTestCompositeConstraint.php \Drupal\entity_test\Entity\EntityTestCompositeConstraint
  2. 11.x core/modules/system/tests/modules/entity_test/src/Plugin/Validation/Constraint/EntityTestCompositeConstraint.php \Drupal\entity_test\Plugin\Validation\Constraint\EntityTestCompositeConstraint

Constraint with multiple fields.

Plugin annotation


@Constraint(
  id = "EntityTestComposite",
  label = @Translation("Constraint with multiple fields."),
  type = "entity"
)

Hierarchy

Expanded class hierarchy of EntityTestCompositeConstraint

1 file declares its use of EntityTestCompositeConstraint
EntityConstraintViolationListTest.php in core/tests/Drupal/Tests/Core/Entity/EntityConstraintViolationListTest.php

File

core/modules/system/tests/modules/entity_test/src/Plugin/Validation/Constraint/EntityTestCompositeConstraint.php, line 16

Namespace

Drupal\entity_test\Plugin\Validation\Constraint
View source
class EntityTestCompositeConstraint extends CompositeConstraintBase {
  public $message = 'Multiple fields are validated';
  
  /**
   * {@inheritdoc}
   */
  public function coversFields() {
    return [
      'name',
      'type',
    ];
  }

}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.