UniqueLabelInListConstraint.php

Same filename in other branches
  1. 9 core/modules/ckeditor5/src/Plugin/Validation/Constraint/UniqueLabelInListConstraint.php
  2. 10 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 Drupal\Core\StringTranslation\TranslatableMarkup;
use Drupal\Core\Validation\Attribute\Constraint;
use Symfony\Component\Validator\Constraint as SymfonyConstraint;

/**
 * Uniquely labeled list item constraint.
 *
 * @internal
 */
class UniqueLabelInListConstraint extends SymfonyConstraint {
    
    /**
     * 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() : array {
        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.