EntityTestCompositeConstraint.php

Same filename in this branch
  1. 11.x core/modules/system/tests/modules/entity_test/src/Entity/EntityTestCompositeConstraint.php
Same filename and directory in other branches
  1. 9 core/modules/system/tests/modules/entity_test/src/Entity/EntityTestCompositeConstraint.php
  2. 9 core/modules/system/tests/modules/entity_test/src/Plugin/Validation/Constraint/EntityTestCompositeConstraint.php
  3. 8.9.x core/modules/system/tests/modules/entity_test/src/Entity/EntityTestCompositeConstraint.php
  4. 8.9.x core/modules/system/tests/modules/entity_test/src/Plugin/Validation/Constraint/EntityTestCompositeConstraint.php
  5. 10 core/modules/system/tests/modules/entity_test/src/Entity/EntityTestCompositeConstraint.php
  6. 10 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;
use Drupal\Core\StringTranslation\TranslatableMarkup;
use Drupal\Core\Validation\Attribute\Constraint;

/**
 * Constraint with multiple fields.
 */
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.