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.

int $cache_expire: A Unix timestamp indicating that the definition list will be considered invalid after this time.

array $cache_tags: The cache tags associated with the definition list.

File

drupal/core/lib/Drupal/Core/Plugin/Discovery/CacheDecorator.php, line 78
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', $cache_expire = CacheBackendInterface::CACHE_PERMANENT, array $cache_tags = array()) {
  $this->decorated = $decorated;
  $this->cacheKey = $cache_key;
  $this->cacheBin = $cache_bin;
  $this->cacheExpire = $cache_expire;
  $this->cacheTags = $cache_tags;
}