UniqueLabelInListConstraint.php

Same filename in other branches
  1. 10 core/modules/ckeditor5/src/Plugin/Validation/Constraint/UniqueLabelInListConstraint.php
  2. 11.x core/modules/ckeditor5/src/Plugin/Validation/Constraint/UniqueLabelInListConstraint.php

Namespace

Drupal\ckeditor5\Plugin\Validation\Constraint

File

core/modules/ckeditor5/src/Plugin/Validation/Constraint/UniqueLabelInListConstraint.php

View source
<?php

declare (strict_types=1);
namespace Drupal\ckeditor5\Plugin\Validation\Constraint;

use Symfony\Component\Validator\Constraint;

/**
 * Uniquely labeled list item constraint.
 *
 * @Constraint(
 *   id = "UniqueLabelInList",
 *   label = @Translation("Unique label in list", context = "Validation"),
 * )
 *
 * @internal
 */
class UniqueLabelInListConstraint extends Constraint {
    
    /**
     * The default violation message.
     *
     * @var string
     */
    public $message = 'The label %label is not unique.';
    
    /**
     * The key of the label that this validation constraint should check.
     *
     * @var null|string
     */
    public $labelKey = NULL;
    
    /**
     * {@inheritdoc}
     */
    public function getRequiredOptions() {
        return [
            'labelKey',
        ];
    }

}

Classes

Title Deprecated Summary
UniqueLabelInListConstraint Uniquely labeled list item constraint.

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