You are here

public function SearchApiSolrAcquiaConnector::submitConfigurationForm in Acquia Search 3.x

Form submission handler.

Parameters

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 form. Calling code should pass on a subform state created through \Drupal\Core\Form\SubformState::createForSubform().

Overrides SolrConnectorPluginBase::submitConfigurationForm

File

src/Plugin/SolrConnector/SearchApiSolrAcquiaConnector.php, line 298

Class

SearchApiSolrAcquiaConnector
Class SearchApiSolrAcquiaConnector.

Namespace

Drupal\acquia_search\Plugin\SolrConnector

Code

public function submitConfigurationForm(array &$form, FormStateInterface $form_state) {
  $values = $form_state
    ->getValues();

  // Clear Acquia Search Solr indexes cache.
  if (!empty(Storage::getIdentifier())) {
    $cid = 'acquia_search.indexes.' . Storage::getIdentifier();
    $this->cache
      ->delete($cid);
  }
  $this->storage
    ->setApiHost($values['api_host']);
  if (!empty($values['api_key'])) {
    $this->storage
      ->setApiKey($values['api_key']);
  }
  $this->storage
    ->setIdentifier($values['identifier']);
  $this->storage
    ->setUuid($values['uuid']);
}