Overrides Drupal\Component\Plugin\PluginManagerBase::getDefinitions().
Overrides PluginManagerBase::getDefinitions
public function getDefinitions() {
// Because \Drupal\Core\Plugin\Discovery\CacheDecorator runs before
// definitions are processed and does not support cache tags, we perform our
// own caching.
if ($cache = cache($this->cacheBin)
->get($this->cacheKey)) {
return $cache->data;
}
else {
// @todo Remove array_filter() once http://drupal.org/node/1780396 is
// resolved.
$definitions = array_filter(parent::getDefinitions());
cache($this->cacheBin)
->set($this->cacheKey, $definitions, $this->cacheExpire, $this->cacheTags);
return $definitions;
}
}