You are here

EntityTestCompositeConstraint.php in Zircon Profile 8.0

File

core/modules/system/tests/modules/entity_test/src/Plugin/Validation/Constraint/EntityTestCompositeConstraint.php
View source
<?php

/**
 * @file
 * Contains \Drupal\entity_test\Plugin\Validation\Constraint\EntityTestCompositeConstraint.
 */
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

Namesort descending Description
EntityTestCompositeConstraint Constraint with multiple fields.