function HelpSearch::getSectionPlugin
Same name and namespace in other branches
- 11.x core/modules/help/src/Plugin/Search/HelpSearch.php \Drupal\help\Plugin\Search\HelpSearch::getSectionPlugin()
Instantiates a help section plugin and verifies it is searchable.
Parameters
string $section_plugin_id: Type of plugin to instantiate.
Return value
\Drupal\help_topics\SearchableHelpInterface|false Plugin object, or FALSE if it is not searchable.
File
-
core/
modules/ help_topics/ src/ Plugin/ Search/ HelpSearch.php, line 520
Class
- HelpSearch
- Handles searching for help using the Search module index.
Namespace
Drupal\help_topics\Plugin\SearchCode
protected function getSectionPlugin($section_plugin_id) {
/** @var \Drupal\help\HelpSectionPluginInterface $section_plugin */
$section_plugin = $this->helpSectionManager
->createInstance($section_plugin_id);
// Intentionally return boolean to allow caching of results.
return $section_plugin instanceof SearchableHelpInterface ? $section_plugin : FALSE;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.