UniquePathAliasConstraint.php

Same filename in other branches
  1. 9 core/lib/Drupal/Core/Path/Plugin/Validation/Constraint/UniquePathAliasConstraint.php
  2. 8.9.x core/lib/Drupal/Core/Path/Plugin/Validation/Constraint/UniquePathAliasConstraint.php
  3. 11.x core/lib/Drupal/Core/Path/Plugin/Validation/Constraint/UniquePathAliasConstraint.php

Namespace

Drupal\Core\Path\Plugin\Validation\Constraint

File

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

View source
<?php

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

use Drupal\Core\StringTranslation\TranslatableMarkup;
use Drupal\Core\Validation\Attribute\Constraint;
use Symfony\Component\Validator\Constraint as SymfonyConstraint;

/**
 * Validation constraint for unique path alias values.
 */
class UniquePathAliasConstraint extends SymfonyConstraint {
    
    /**
     * 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.';

}

Classes

Title Deprecated Summary
UniquePathAliasConstraint Validation constraint for unique path alias values.

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