You are here

public static function SuggestionStorage::mergeSuggestion in Autocomplete Search Suggestions 3.0.x

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

Merge the supplied suggestion.

Parameters

array $key: The suggestion key array.

array $fields: The suggestion field array.

Return value

object A Merge object.

4 calls to SuggestionStorage::mergeSuggestion()
SuggestionEditForm::submitForm in src/Form/SuggestionEditForm.php
AJAX callback for the indexing form.
SuggestionHelper::insert in src/SuggestionHelper.php
Add a suggestion.
SuggestionHelper::updateSrc in src/SuggestionHelper.php
Calculate the ngram's density.
suggestion_surfer_submit in ./suggestion.module
Custom submit function to add surfer suggestions.

File

src/SuggestionStorage.php, line 266

Class

SuggestionStorage
Database CRUD.

Namespace

Drupal\suggestion

Code

public static function mergeSuggestion(array $key = [], array $fields = []) {
  return \Drupal::database()
    ->merge('suggestion')
    ->key($key)
    ->fields($fields)
    ->execute();
}