public function CacheDecorator::__construct

Constructs a Drupal\Core\Plugin\Discovery\CacheDecorator object.

It uses the DiscoveryInterface object it should decorate.

Parameters

Drupal\Component\Plugin\Discovery\DiscoveryInterface $decorated: The object implementing DiscoveryInterface that is being decorated.

string $cache_key: The cache identifier used for storage of the definition list.

string $cache_bin: The cache bin used for storage and retrieval of the definition list.

File

drupal/core/lib/Drupal/Core/Plugin/Discovery/CacheDecorator.php, line 58
Definition of Drupal\Core\Plugin\Discovery\CacheDecorator.

Class

CacheDecorator
Enables static and persistent caching of discovered plugin definitions.

Namespace

Drupal\Core\Plugin\Discovery

Code

public function __construct(DiscoveryInterface $decorated, $cache_key, $cache_bin = 'cache') {
  $this->decorated = $decorated;
  $this->cacheKey = $cache_key;
  $this->cacheBin = $cache_bin;
}