function SearchHelpSearch::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\SearchableHelpInterface|false Plugin object, or FALSE if it is not searchable.

File

core/modules/search/modules/search_help/src/Plugin/Search/SearchHelpSearch.php, line 449

Class

SearchHelpSearch
Handles searching for help using the Search module index.

Namespace

Drupal\search_help\Plugin\Search

Code

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.