You are here

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

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.2 src/Plugin/search_api/processor/Property/SiteNameProperty.php \Drupal\search_api_field_map\Plugin\search_api\processor\Property\SiteNameProperty::submitConfigurationForm()
  3. 4.x src/Plugin/search_api/processor/Property/SiteNameProperty.php \Drupal\search_api_field_map\Plugin\search_api\processor\Property\SiteNameProperty::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/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);
}