You are here

public static function SuggestionStorage::mergeSuggestion in Autocomplete Search Suggestions 8

Same name and namespace in other branches
  1. 8.2 src/SuggestionStorage.php \Drupal\suggestion\SuggestionStorage::mergeSuggestion()
  2. 3.0.x 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 253

Class

SuggestionStorage
Database CRUD.

Namespace

Drupal\suggestion

Code

public static function mergeSuggestion(array $key = [], array $fields = []) {
  return db_merge('suggestion')
    ->key($key)
    ->fields($fields)
    ->execute();
}