You are here

public static function SuggestionHelper::setConfig in Autocomplete Search Suggestions 3.0.x

Same name and namespace in other branches
  1. 8.2 src/SuggestionHelper.php \Drupal\suggestion\SuggestionHelper::setConfig()
  2. 8 src/SuggestionHelper.php \Drupal\suggestion\SuggestionHelper::setConfig()

Configuration get wrapper.

Parameters

string $key: The field name.

mixed $val: The field value.

Return value

mixed The value of the supplied field.

6 calls to SuggestionHelper::setConfig()
SuggestionAdminForm::setAutocomplete in src/Form/SuggestionAdminForm.php
Build an autocomplete form ID to field name hash.
SuggestionAdminForm::setStopwords in src/Form/SuggestionAdminForm.php
Process all the stopwords submitted.
SuggestionAdminForm::setSynced in src/Form/SuggestionAdminForm.php
Set the synced value.
SuggestionAdminForm::submitForm in src/Form/SuggestionAdminForm.php
Submit function for the suggestion configuration form.
SuggestionBlock::blockSubmit in src/Plugin/Block/SuggestionBlock.php

... See full list

File

src/SuggestionHelper.php, line 238

Class

SuggestionHelper
Provides helper methods for suggestions.

Namespace

Drupal\suggestion

Code

public static function setConfig($key = '', $val = NULL) {
  $cfg =& drupal_static(__CLASS__ . '_' . __FUNCTION__, \Drupal::configFactory()
    ->getEditable('suggestion.config'));
  return $key ? $cfg
    ->set($key, $val)
    ->save() : NULL;
}