You are here

protected function SearchApiFederatedSolrRemap::indexFieldOptions in Search API Federated Solr 7

Same name and namespace in other branches
  1. 7.3 src/SearchApiFederatedSolrRemap.php \SearchApiFederatedSolrRemap::indexFieldOptions()
  2. 7.2 src/SearchApiFederatedSolrRemap.php \SearchApiFederatedSolrRemap::indexFieldOptions()

Get a form options array containing all of the fields that can be remapped.

Return value

array

1 call to SearchApiFederatedSolrRemap::indexFieldOptions()
SearchApiFederatedSolrRemap::configurationForm in src/SearchApiFederatedSolrRemap.php
Implements SearchApiAlterCallbackInterface::configurationForm().

File

src/SearchApiFederatedSolrRemap.php, line 129

Class

SearchApiFederatedSolrRemap
Class SearchApiFederatedSolrRemap Provides a Search API index data alteration that remaps property names for indexed items.

Code

protected function indexFieldOptions() {
  $options = array_diff_key($this->index
    ->getFields(FALSE), $this
    ->federatedFields());
  array_walk($options, function (&$item, $key) {
    $item = t('@name (@machine_name)', [
      '@name' => $item['name'],
      '@machine_name' => $key,
    ]);
  });
  return [
    '- ' . t('None') . ' -',
  ] + $options;
}