protected function CacheDecorator::getCachedDefinitions

Returns the cached plugin definitions of the decorated discovery class.

Return value

mixed On success this will return an array of plugin definitions. On failure this should return NULL, indicating to other methods that this has not yet been defined. Success with no values should return as an empty array and would actually be returned by the getDefinitions() method.

1 call to CacheDecorator::getCachedDefinitions()
CacheDecorator::getDefinitions in drupal/core/lib/Drupal/Core/Plugin/Discovery/CacheDecorator.php
Implements Drupal\Component\Plugin\Discovery\DicoveryInterface::getDefinitions().

File

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

Class

CacheDecorator
Enables static and persistent caching of discovered plugin definitions.

Namespace

Drupal\Core\Plugin\Discovery

Code

protected function getCachedDefinitions() {
  if (!isset($this->definitions) && isset($this->cacheKey) && ($cache = cache($this->cacheBin)
    ->get($this->cacheKey))) {
    $this->definitions = $cache->data;
  }
  return $this->definitions;
}