function CachedDiscoveryClearer::addCachedDiscovery

Same name in this branch
  1. 11.x core/lib/Drupal/Core/ProxyClass/Plugin/CachedDiscoveryClearer.php \Drupal\Core\ProxyClass\Plugin\CachedDiscoveryClearer::addCachedDiscovery()
Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/ProxyClass/Plugin/CachedDiscoveryClearer.php \Drupal\Core\ProxyClass\Plugin\CachedDiscoveryClearer::addCachedDiscovery()
  2. 9 core/lib/Drupal/Core/Plugin/CachedDiscoveryClearer.php \Drupal\Core\Plugin\CachedDiscoveryClearer::addCachedDiscovery()
  3. 8.9.x core/lib/Drupal/Core/ProxyClass/Plugin/CachedDiscoveryClearer.php \Drupal\Core\ProxyClass\Plugin\CachedDiscoveryClearer::addCachedDiscovery()
  4. 8.9.x core/lib/Drupal/Core/Plugin/CachedDiscoveryClearer.php \Drupal\Core\Plugin\CachedDiscoveryClearer::addCachedDiscovery()
  5. 10 core/lib/Drupal/Core/ProxyClass/Plugin/CachedDiscoveryClearer.php \Drupal\Core\ProxyClass\Plugin\CachedDiscoveryClearer::addCachedDiscovery()
  6. 10 core/lib/Drupal/Core/Plugin/CachedDiscoveryClearer.php \Drupal\Core\Plugin\CachedDiscoveryClearer::addCachedDiscovery()

Adds a plugin manager to the active list.

Parameters

\Drupal\Component\Plugin\Discovery\CachedDiscoveryInterface $cached_discovery: An object that implements the cached discovery interface, typically a plugin manager.

Deprecated

in drupal:11.1.0 and is removed from drupal:12.0.0. Pass the full set of services to the constructor instead.

See also

https://www.drupal.org/node/3442229

File

core/lib/Drupal/Core/Plugin/CachedDiscoveryClearer.php, line 35

Class

CachedDiscoveryClearer
Defines a class which is capable of clearing the cache on plugin managers.

Namespace

Drupal\Core\Plugin

Code

public function addCachedDiscovery(CachedDiscoveryInterface $cached_discovery) {
    @trigger_error('The ' . __METHOD__ . ' method is deprecated in drupal:11.1.0 and is removed from drupal:12.0.0. Pass the full set of services to the constructor instead. See https://www.drupal.org/node/3442229', E_USER_DEPRECATED);
    $this->legacyCachedDiscoveries[] = $cached_discovery;
}

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