You are here

public static function SuggestionStorage::getSuggestion in Autocomplete Search Suggestions 7

Fetch the data for the suplied ngram.

Parameters

string $ngram: The requested ngram.

Return value

object An array of suggestion objects.

2 calls to SuggestionStorage::getSuggestion()
SuggestionHelper::updateSrc in src/SuggestionHelper.php
Calculate the ngram's density.
suggestion_admin_edit_form in ./suggestion.admin.inc
Menu callback to index suggestions.

File

src/SuggestionStorage.php, line 203
CRUD methods for the suggestion module.

Class

SuggestionStorage
Database CRUD.

Code

public static function getSuggestion($ngram = '') {
  return db_query("SELECT * FROM {suggestion} WHERE ngram = :ngram", array(
    ':ngram' => $ngram,
  ))
    ->fetchObject();
}