Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x

ConfigExistsConstraint.php

Namespace

Drupal\Core\Config\Plugin\Validation\Constraint

File

core/lib/Drupal/Core/Config/Plugin/Validation/Constraint/ConfigExistsConstraint.php

View source
<?php

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

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

/**
 * Checks that the value is the name of an existing config object.
 */
class ConfigExistsConstraint extends SymfonyConstraint {
    
    /**
     * The error message.
     *
     * @var string
     */
    public string $message = "The '@name' config does not exist.";
    
    /**
     * Optional prefix, to be specified when this contains a config entity ID.
     *
     * Every config entity type can have multiple instances, all with unique IDs
     * but the same config prefix. When config refers to a config entity,
     * typically only the ID is stored, not the prefix.
     *
     * @var string
     */
    public string $prefix = '';

}

Classes

Title Deprecated Summary
ConfigExistsConstraint Checks that the value is the name of an existing config object.

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal