function HelpTopicSection::getCacheMetadata

Same name in other branches
  1. 9 core/modules/help_topics/src/Plugin/HelpSection/HelpTopicSection.php \Drupal\help_topics\Plugin\HelpSection\HelpTopicSection::getCacheMetadata()
  2. 8.9.x core/modules/help_topics/src/Plugin/HelpSection/HelpTopicSection.php \Drupal\help_topics\Plugin\HelpSection\HelpTopicSection::getCacheMetadata()
  3. 10 core/modules/help/src/Plugin/HelpSection/HelpTopicSection.php \Drupal\help\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/src/Plugin/HelpSection/HelpTopicSection.php, line 231

Class

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

Namespace

Drupal\help\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;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.