You are here

public function SiteNameProperty::submitConfigurationForm in Search API Field Map 4.x

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

File

src/Plugin/search_api/processor/Property/SiteNameProperty.php, line 66

Class

SiteNameProperty
Defines a "site name" property.

Namespace

Drupal\search_api_field_map\Plugin\search_api\processor\Property

Code

public function submitConfigurationForm(FieldInterface $field, array &$form, FormStateInterface $form_state) {
  $values = [
    'site_name' => $form_state
      ->getValue('site_name'),
  ];
  if ($domains = $form_state
    ->getValue('domain')) {
    foreach ($domains as $id => $value) {
      $values['domain'][$id] = $value;
    }
  }
  $field
    ->setConfiguration($values);
}