class CachedDiscoveryClearer

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

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

Hierarchy

Expanded class hierarchy of CachedDiscoveryClearer

1 string reference to 'CachedDiscoveryClearer'
core.services.yml in core/core.services.yml
core/core.services.yml
1 service uses CachedDiscoveryClearer
plugin.cache_clearer in core/core.services.yml
Drupal\Core\Plugin\CachedDiscoveryClearer

File

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

Namespace

Drupal\Core\Plugin
View source
class CachedDiscoveryClearer implements CachedDiscoveryClearerInterface {
    
    /**
     * The stored discoveries.
     *
     * @var \Drupal\Component\Plugin\Discovery\CachedDiscoveryInterface[]
     */
    protected $cachedDiscoveries = [];
    
    /**
     * {@inheritdoc}
     */
    public function addCachedDiscovery(CachedDiscoveryInterface $cached_discovery) {
        $this->cachedDiscoveries[] = $cached_discovery;
    }
    
    /**
     * {@inheritdoc}
     */
    public function clearCachedDefinitions() {
        foreach ($this->cachedDiscoveries as $cached_discovery) {
            $cached_discovery->clearCachedDefinitions();
        }
    }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title
CachedDiscoveryClearer::$cachedDiscoveries protected property The stored discoveries.
CachedDiscoveryClearer::addCachedDiscovery public function Adds a plugin manager to the active list. Overrides CachedDiscoveryClearerInterface::addCachedDiscovery
CachedDiscoveryClearer::clearCachedDefinitions public function Clears the cache on all cached discoveries. Overrides CachedDiscoveryClearerInterface::clearCachedDefinitions

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