You are here

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

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

Configuration get wrapper.

Parameters

string $key: The field name.

mixed $val: The field value.

Return value

mixed The value of the supplied field.

1 call to SuggestionHelper::setStops()
SuggestionAdminForm::setStopwords in src/Form/SuggestionAdminForm.php
Process all the stopwords submitted.

File

src/SuggestionHelper.php, line 255

Class

SuggestionHelper
Provides helper methods for suggestions.

Namespace

Drupal\suggestion

Code

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