You are here

TaxonomyUnique.php in Taxonomy unique 8.2

File

src/Plugin/Validation/Constraint/TaxonomyUnique.php
View source
<?php

namespace Drupal\taxonomy_unique\Plugin\Validation\Constraint;

use Symfony\Component\Validator\Constraint;

/**
 * Taxonomy unique constraint.
 *
 * @Constraint(
 *   id = "taxonomy_unique",
 *   label = @Translation("Taxonomy unique", context = "Validation")
 * )
 */
class TaxonomyUnique extends Constraint {
  public $notUnique = TAXONOMY_UNIQUE_DEFAULT_MESSAGE;

  /**
   * Overwrites the default error message.
   */
  public function setErrorMessage($message) {
    $this->notUnique = $message;
  }

}

Classes

Namesort descending Description
TaxonomyUnique Taxonomy unique constraint.