RoleExistsConstraint.php

Namespace

Drupal\user\Plugin\Validation\Constraint

File

core/modules/user/src/Plugin/Validation/Constraint/RoleExistsConstraint.php

View source
<?php

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

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

/**
 * Checks if a role exists.
 */
class RoleExistsConstraint extends SymfonyConstraint {
    
    /**
     * The error message if validation fails.
     *
     * @var string
     */
    public $message = "The role with id '@rid' does not exist.";

}

Classes

Title Deprecated Summary
RoleExistsConstraint Checks if a role exists.

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