class EntityTestCompositeConstraint

Same name in this branch
  1. 11.x core/modules/system/tests/modules/entity_test/src/Entity/EntityTestCompositeConstraint.php \Drupal\entity_test\Entity\EntityTestCompositeConstraint
Same name in other branches
  1. 9 core/modules/system/tests/modules/entity_test/src/Entity/EntityTestCompositeConstraint.php \Drupal\entity_test\Entity\EntityTestCompositeConstraint
  2. 9 core/modules/system/tests/modules/entity_test/src/Plugin/Validation/Constraint/EntityTestCompositeConstraint.php \Drupal\entity_test\Plugin\Validation\Constraint\EntityTestCompositeConstraint
  3. 8.9.x core/modules/system/tests/modules/entity_test/src/Entity/EntityTestCompositeConstraint.php \Drupal\entity_test\Entity\EntityTestCompositeConstraint
  4. 8.9.x core/modules/system/tests/modules/entity_test/src/Plugin/Validation/Constraint/EntityTestCompositeConstraint.php \Drupal\entity_test\Plugin\Validation\Constraint\EntityTestCompositeConstraint
  5. 10 core/modules/system/tests/modules/entity_test/src/Entity/EntityTestCompositeConstraint.php \Drupal\entity_test\Entity\EntityTestCompositeConstraint
  6. 10 core/modules/system/tests/modules/entity_test/src/Plugin/Validation/Constraint/EntityTestCompositeConstraint.php \Drupal\entity_test\Plugin\Validation\Constraint\EntityTestCompositeConstraint

Constraint with multiple fields.

Hierarchy

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

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 14

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',
        ];
    }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title
EntityTestCompositeConstraint::$message public property
EntityTestCompositeConstraint::coversFields public function An array of entity fields which should be passed to the validator. Overrides CompositeConstraintBase::coversFields

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