public function CacheDecorator::getDefinitions

Implements Drupal\Component\Plugin\Discovery\DicoveryInterface::getDefinitions().

Overrides DiscoveryInterface::getDefinitions

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

File

drupal/core/lib/Drupal/Core/Plugin/Discovery/CacheDecorator.php, line 111
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 getDefinitions() {

  // Optimize for fast access to definitions if they are already in memory.
  if (isset($this->definitions)) {
    return $this->definitions;
  }
  $definitions = $this
    ->getCachedDefinitions();
  if (!isset($definitions)) {
    $definitions = $this->decorated
      ->getDefinitions();
    $this
      ->setCachedDefinitions($definitions);
  }
  return $definitions;
}