You are here

protected function DevelController::getBackends in Search API Solr 8.2

Same name and namespace in other branches
  1. 8.3 modules/search_api_solr_devel/src/Controller/DevelController.php \Drupal\search_api_solr_devel\Controller\DevelController::getBackends()
  2. 4.x modules/search_api_solr_devel/src/Controller/DevelController.php \Drupal\search_api_solr_devel\Controller\DevelController::getBackends()

Returns all available Solr backend plugins.

Return value

string[] An associative array mapping backend plugin IDs to their (HTML-escaped) labels.

1 call to DevelController::getBackends()
DevelController::entitySolr in search_api_solr_devel/src/Controller/DevelController.php
Prints the document structure to be indexed by Solr.

File

search_api_solr_devel/src/Controller/DevelController.php, line 106

Class

DevelController
Returns responses for devel module routes.

Namespace

Drupal\search_api_solr_devel\Controller

Code

protected function getBackends() {
  $backends = [];
  $plugin_definitions = $this
    ->getBackendPluginManager()
    ->getDefinitions();
  foreach ($plugin_definitions as $plugin_id => $plugin_definition) {
    if (is_a($plugin_definition['class'], $plugin_definitions['search_api_solr']['class'], TRUE)) {
      $backends[] = $plugin_id;
    }
  }
  return $backends;
}