EntityTestCompositeConstraint.php

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

Namespace

Drupal\entity_test\Plugin\Validation\Constraint

File

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

View source
<?php

namespace Drupal\entity_test\Plugin\Validation\Constraint;

use Drupal\Core\Entity\Plugin\Validation\Constraint\CompositeConstraintBase;

/**
 * Constraint with multiple fields.
 *
 * @Constraint(
 *   id = "EntityTestComposite",
 *   label = @Translation("Constraint with multiple fields."),
 *   type = "entity"
 * )
 */
class EntityTestCompositeConstraint extends CompositeConstraintBase {
    public $message = 'Multiple fields are validated';
    
    /**
     * {@inheritdoc}
     */
    public function coversFields() {
        return [
            'name',
            'type',
        ];
    }

}

Classes

Title Deprecated Summary
EntityTestCompositeConstraint Constraint with multiple fields.

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