Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. HelpSearch.php

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

3 calls to HelpSearch::getSectionPlugin()
HelpSearch::prepareResults in core/modules/help/src/Plugin/Search/HelpSearch.php
Prepares search results for display.
HelpSearch::updateIndex in core/modules/help/src/Plugin/Search/HelpSearch.php
Updates the search index for this plugin.
HelpSearch::updateTopicList in core/modules/help/src/Plugin/Search/HelpSearch.php
Rebuilds the database table containing topics to be indexed.

File

core/modules/help/src/Plugin/Search/HelpSearch.php, line 519

Class

HelpSearch
Handles searching for help using the Search module index.

Namespace

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

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal