You are here

protected function ConstraintManager::getDiscovery in Drupal 10

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Validation/ConstraintManager.php \Drupal\Core\Validation\ConstraintManager::getDiscovery()
  2. 9 core/lib/Drupal/Core/Validation/ConstraintManager.php \Drupal\Core\Validation\ConstraintManager::getDiscovery()

Gets the plugin discovery.

Return value

\Drupal\Component\Plugin\Discovery\DiscoveryInterface

Overrides DefaultPluginManager::getDiscovery

1 call to ConstraintManager::getDiscovery()
ConstraintManager::registerDefinitions in core/lib/Drupal/Core/Validation/ConstraintManager.php
Callback for registering definitions for constraints shipped with Symfony.

File

core/lib/Drupal/Core/Validation/ConstraintManager.php, line 52

Class

ConstraintManager
Constraint plugin manager.

Namespace

Drupal\Core\Validation

Code

protected function getDiscovery() {
  if (!isset($this->discovery)) {
    $this->discovery = parent::getDiscovery();
    $this->discovery = new StaticDiscoveryDecorator($this->discovery, [
      $this,
      'registerDefinitions',
    ]);
  }
  return $this->discovery;
}