You are here

public function SearchApiAlterAddAggregation::configurationFormSubmit in Search API 7

Implements SearchApiAlterCallbackInterface::configurationFormSubmit().

Overrides SearchApiAbstractAlterCallback::configurationFormSubmit

File

includes/callback_add_aggregation.inc, line 163
Contains SearchApiAlterAddAggregation.

Class

SearchApiAlterAddAggregation
Search API data alteration callback that adds an URL field for all items.

Code

public function configurationFormSubmit(array $form, array &$values, array &$form_state) {
  if (empty($values['fields'])) {
    return array();
  }
  $index_fields = $this->index
    ->getFields(FALSE);
  foreach ($values['fields'] as $name => $field) {
    if (!$field['name']) {
      unset($values['fields'][$name]);
    }
    else {
      $values['fields'][$name]['description'] = $this
        ->fieldDescription($field, $index_fields);
    }
  }
  $this->options = $values;
  return $values;
}