You are here

class UniquePathAliasConstraint in Drupal 9

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Path/Plugin/Validation/Constraint/UniquePathAliasConstraint.php \Drupal\Core\Path\Plugin\Validation\Constraint\UniquePathAliasConstraint

Validation constraint for unique path alias values.

Plugin annotation


@Constraint(
  id = "UniquePathAlias",
  label = @Translation("Unique path alias.", context = "Validation"),
)

Hierarchy

  • class \Drupal\Core\Path\Plugin\Validation\Constraint\UniquePathAliasConstraint extends \Symfony\Component\Validator\Constraint

Expanded class hierarchy of UniquePathAliasConstraint

File

core/lib/Drupal/Core/Path/Plugin/Validation/Constraint/UniquePathAliasConstraint.php, line 15

Namespace

Drupal\Core\Path\Plugin\Validation\Constraint
View source
class UniquePathAliasConstraint extends Constraint {

  /**
   * The default violation message.
   *
   * @var string
   */
  public $message = 'The alias %alias is already in use in this language.';

  /**
   * Violation message when the path alias exists with different capitalization.
   *
   * @var string
   */
  public $differentCapitalizationMessage = 'The alias %alias could not be added because it is already in use in this language with different capitalization: %stored_alias.';

}

Members

Namesort descending Modifiers Type Description Overrides
UniquePathAliasConstraint::$differentCapitalizationMessage public property Violation message when the path alias exists with different capitalization.
UniquePathAliasConstraint::$message public property The default violation message.