protected function HelpSearch::getSectionPlugin in Drupal 9
Same name and namespace in other branches
- 8 core/modules/help_topics/src/Plugin/Search/HelpSearch.php \Drupal\help_topics\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.
3 calls to HelpSearch::getSectionPlugin()
- HelpSearch::prepareResults in core/
modules/ help_topics/ src/ Plugin/ Search/ HelpSearch.php - Prepares search results for display.
- HelpSearch::updateIndex in core/
modules/ help_topics/ src/ Plugin/ Search/ HelpSearch.php - Updates the search index for this plugin.
- HelpSearch::updateTopicList in core/
modules/ help_topics/ src/ Plugin/ Search/ HelpSearch.php - Rebuilds the database table containing topics to be indexed.
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;
}