You are here

public function MappedFieldProperty::submitConfigurationForm in Search API Field Map 8

Same name and namespace in other branches
  1. 8.3 src/Plugin/search_api/processor/Property/MappedFieldProperty.php \Drupal\search_api_field_map\Plugin\search_api\processor\Property\MappedFieldProperty::submitConfigurationForm()
  2. 8.2 src/Plugin/search_api/processor/Property/MappedFieldProperty.php \Drupal\search_api_field_map\Plugin\search_api\processor\Property\MappedFieldProperty::submitConfigurationForm()
  3. 4.x src/Plugin/search_api/processor/Property/MappedFieldProperty.php \Drupal\search_api_field_map\Plugin\search_api\processor\Property\MappedFieldProperty::submitConfigurationForm()

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/MappedFieldProperty.php, line 88

Class

MappedFieldProperty
Defines an "mapped field" property.

Namespace

Drupal\search_api_field_map\Plugin\search_api\processor\Property

Code

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