You are here

protected function HelpTopicSection::getCacheMetadata in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/help_topics/src/Plugin/HelpSection/HelpTopicSection.php \Drupal\help_topics\Plugin\HelpSection\HelpTopicSection::getCacheMetadata()
  2. 9 core/modules/help_topics/src/Plugin/HelpSection/HelpTopicSection.php \Drupal\help_topics\Plugin\HelpSection\HelpTopicSection::getCacheMetadata()

Gets the merged CacheableMetadata for all the top level help topic plugins.

Return value

\Drupal\Core\Cache\CacheableMetadata The merged CacheableMetadata for all the top level help topic plugins.

File

core/modules/help_topics/src/Plugin/HelpSection/HelpTopicSection.php, line 273

Class

HelpTopicSection
Provides the help topics list section for the help page.

Namespace

Drupal\help_topics\Plugin\HelpSection

Code

protected function getCacheMetadata() {
  if (!isset($this->cacheableMetadata)) {
    $this->cacheableMetadata = new CacheableMetadata();
    foreach ($this
      ->getPlugins() as $plugin) {
      $this->cacheableMetadata
        ->addCacheableDependency($plugin);
    }
  }
  return $this->cacheableMetadata;
}