You are here

public static function SolrFieldType::getAvailableDomains in Search API Solr 8.2

Same name and namespace in other branches
  1. 8.3 src/Entity/SolrFieldType.php \Drupal\search_api_solr\Entity\SolrFieldType::getAvailableDomains()
  2. 4.x src/Entity/SolrFieldType.php \Drupal\search_api_solr\Entity\SolrFieldType::getAvailableDomains()

Get all available domains form solr filed type configs.

Return value

string[]

1 call to SolrFieldType::getAvailableDomains()
SearchApiSolrBackend::buildConfigurationForm in src/Plugin/search_api/backend/SearchApiSolrBackend.php
Form constructor.

File

src/Entity/SolrFieldType.php, line 146

Class

SolrFieldType
Defines the SolrFieldType entity.

Namespace

Drupal\search_api_solr\Entity

Code

public static function getAvailableDomains() {
  $domains = [
    'generic',
  ];
  $config_factory = \Drupal::configFactory();
  foreach ($config_factory
    ->listAll('search_api_solr.solr_field_type.') as $field_type_name) {
    $config = $config_factory
      ->get($field_type_name);
    $domains = array_merge($domains, $config
      ->get('domains'));
  }
  sort($domains);
  return array_unique($domains);
}