You are here

public function GlossaryAZWidgetOrderProcessor::sortConfigurationWeight in Search API AZ Glossary 8

Same name and namespace in other branches
  1. 8.4 src/Plugin/facets/processor/GlossaryAZWidgetOrderProcessor.php \Drupal\search_api_glossary\Plugin\facets\processor\GlossaryAZWidgetOrderProcessor::sortConfigurationWeight()
  2. 8.2 src/Plugin/facets/processor/GlossaryAZWidgetOrderProcessor.php \Drupal\search_api_glossary\Plugin\facets\processor\GlossaryAZWidgetOrderProcessor::sortConfigurationWeight()
  3. 8.3 src/Plugin/facets/processor/GlossaryAZWidgetOrderProcessor.php \Drupal\search_api_glossary\Plugin\facets\processor\GlossaryAZWidgetOrderProcessor::sortConfigurationWeight()
3 calls to GlossaryAZWidgetOrderProcessor::sortConfigurationWeight()
GlossaryAZWidgetOrderProcessor::build in src/Plugin/facets/processor/GlossaryAZWidgetOrderProcessor.php
GlossaryAZWidgetOrderProcessor::buildConfigurationForm in src/Plugin/facets/processor/GlossaryAZWidgetOrderProcessor.php
Adds a configuration form for this processor.
GlossaryAZWidgetOrderProcessor::sortResults in src/Plugin/facets/processor/GlossaryAZWidgetOrderProcessor.php
Orders results and return the new order of results.

File

src/Plugin/facets/processor/GlossaryAZWidgetOrderProcessor.php, line 199

Class

GlossaryAZWidgetOrderProcessor
A processor that orders the results by display value.

Namespace

Drupal\search_api_glossary\Plugin\facets\processor

Code

public function sortConfigurationWeight($sort_options) {
  foreach ($sort_options as $sort_option_id => $sort_option) {
    $sort_options_by_weight[$sort_option_id] = $sort_option['weight'];
  }

  // Sort by weight options.
  asort($sort_options_by_weight);
  return $sort_options_by_weight;
}