CompositeConstraintBase.php

Same filename and directory in other branches
  1. 9 core/lib/Drupal/Core/Entity/Plugin/Validation/Constraint/CompositeConstraintBase.php
  2. 8.9.x core/lib/Drupal/Core/Entity/Plugin/Validation/Constraint/CompositeConstraintBase.php
  3. 10 core/lib/Drupal/Core/Entity/Plugin/Validation/Constraint/CompositeConstraintBase.php

Namespace

Drupal\Core\Entity\Plugin\Validation\Constraint

File

core/lib/Drupal/Core/Entity/Plugin/Validation/Constraint/CompositeConstraintBase.php

View source
<?php

namespace Drupal\Core\Entity\Plugin\Validation\Constraint;

use Symfony\Component\Validator\Constraint;

/**
 * Provides a base class for constraints validating multiple fields.
 *
 * The constraint must be defined on entity-level; i.e., added to the entity
 * type.
 *
 * @see \Drupal\Core\Entity\EntityType::addConstraint
 */
abstract class CompositeConstraintBase extends Constraint {
    
    /**
     * An array of entity fields which should be passed to the validator.
     *
     * @return string[]
     *   An array of field names.
     */
    public abstract function coversFields();

}

Classes

Title Deprecated Summary
CompositeConstraintBase Provides a base class for constraints validating multiple fields.

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