You are here

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

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

Stopword get wrapper.

Parameters

string $key: The field name.

Return value

mixed The value of the supplied field.

3 calls to SuggestionHelper::getStops()
SuggestionAdminForm::getStopwords in src/Form/SuggestionAdminForm.php
Build a list of stopwords.
SuggestionAdminForm::setStopwords in src/Form/SuggestionAdminForm.php
Process all the stopwords submitted.
SuggestionHelper::atomize in src/SuggestionHelper.php
Transform a string to an array.

File

src/SuggestionHelper.php, line 120

Class

SuggestionHelper
Provides helper methods for suggestions.

Namespace

Drupal\suggestion

Code

public static function getStops($key = '') {
  $cfg =& drupal_static(__CLASS__ . '_' . __FUNCTION__, \Drupal::configFactory()
    ->get('suggestion.stopword'));
  return $key ? $cfg
    ->get($key) : (object) $cfg
    ->get();
}