You are here

public function PluginDiscoveryDecorator::useCaches in Plugin 8.2

Disable the use of caches.

Can be used to ensure that uncached plugin definitions are returned, without invalidating all cached information.

This will also remove all local/static caches.

Parameters

bool $use_caches: FALSE to not use any caches.

Overrides CachedDiscoveryInterface::useCaches

File

src/PluginDiscovery/PluginDiscoveryDecorator.php, line 82

Class

PluginDiscoveryDecorator
Decorates plugin discovery.

Namespace

Drupal\plugin\PluginDiscovery

Code

public function useCaches($use_caches = FALSE) {
  $this->useCaches = $use_caches;
  $decorated_discovery = $this->decoratedDiscovery;
  if ($decorated_discovery instanceof CachedDiscoveryInterface) {
    $decorated_discovery
      ->useCaches($use_caches);
  }
  $this
    ->clearCachedDefinitions();
}