You are here

public static function SolrFieldType::getAvailableCustomCodes in Search API Solr 4.x

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

Get all available custom codes.

Return value

string[] An array of custom codes as strings.

3 calls to SolrFieldType::getAvailableCustomCodes()
CustomTextDataType::getDerivativeDefinitions in src/Plugin/Derivative/CustomTextDataType.php
Gets the definition of all derivatives of a base plugin.
OmitNormsCustomTextDataType::getDerivativeDefinitions in src/Plugin/Derivative/OmitNormsCustomTextDataType.php
Gets the definition of all derivatives of a base plugin.
SearchApiSolrBackend::supportsDataType in src/Plugin/search_api/backend/SearchApiSolrBackend.php

File

src/Entity/SolrFieldType.php, line 218

Class

SolrFieldType
Defines the SolrFieldType entity.

Namespace

Drupal\search_api_solr\Entity

Code

public static function getAvailableCustomCodes() {
  $custom_codes = [];
  $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);
    if ($custom_code = $config
      ->get('custom_code')) {
      $custom_codes[] = $custom_code;
    }
  }
  return array_unique($custom_codes);
}