function ConstraintManager::getDiscovery

Same name in other branches
  1. 9 core/lib/Drupal/Core/Validation/ConstraintManager.php \Drupal\Core\Validation\ConstraintManager::getDiscovery()
  2. 10 core/lib/Drupal/Core/Validation/ConstraintManager.php \Drupal\Core\Validation\ConstraintManager::getDiscovery()
  3. 11.x core/lib/Drupal/Core/Validation/ConstraintManager.php \Drupal\Core\Validation\ConstraintManager::getDiscovery()

Overrides DefaultPluginManager::getDiscovery

File

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

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;
}

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