You are here

public function AggregatedFieldProperty::submitConfigurationForm in Search API 8

Submits a configuration form for a field based on this property.

Parameters

\Drupal\search_api\Item\FieldInterface $field: The field for which the configuration form is submitted.

array $form: An associative array containing the structure of the plugin form as built by static::buildConfigurationForm().

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the complete form.

Overrides ConfigurablePropertyBase::submitConfigurationForm

File

src/Plugin/search_api/processor/Property/AggregatedFieldProperty.php, line 114

Class

AggregatedFieldProperty
Defines an "aggregated field" property.

Namespace

Drupal\search_api\Plugin\search_api\processor\Property

Code

public function submitConfigurationForm(FieldInterface $field, array &$form, FormStateInterface $form_state) {
  $values = [
    'type' => $form_state
      ->getValue('type'),
    'fields' => array_keys(array_filter($form_state
      ->getValue('fields'))),
  ];
  $field
    ->setConfiguration($values);
}