You are here

public function DefaultPluginManager::setCacheBackend in Plug 7

Initialize the cache backend.

Plugin definitions are cached using the provided cache backend. The interface language is added as a suffix to the cache key.

Parameters

\DrupalCacheInterface $cache_backend: Cache backend instance to use.

string $cache_key: Cache key prefix to use, the language code will be appended automatically.

2 calls to DefaultPluginManager::setCacheBackend()
FruitPluginManager::__construct in modules/plug_example/src/FruitPluginManager.php
Constructs FruitPluginManager.
NamePluginManager::__construct in modules/plug_example/src/NamePluginManager.php
Constructs NamePluginManager.

File

lib/Drupal/Core/Plugin/DefaultPluginManager.php, line 144
Contains \Drupal\Core\Plugin\DefaultPluginManager.

Class

DefaultPluginManager
Base class for plugin managers.

Namespace

Drupal\Core\Plugin

Code

public function setCacheBackend(\DrupalCacheInterface $cache_backend, $cache_key) {
  $this->cacheBackend = $cache_backend;
  $this->cacheKey = $cache_key;
}