You are here

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

Fetch the quantity for the supplied ngram.

Parameters

string $ngram: The ngram value.

Return value

int The qty value for the supplied ngram.

2 calls to SuggestionStorage::getNgramQty()
SuggestionHelper::insert in src/SuggestionHelper.php
Add a suggestion.
suggestion_surfer_submit in ./suggestion.module
Custom submit function to add surfer suggestions.

File

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

Class

SuggestionStorage
Database CRUD.

Code

public static function getNgramQty($ngram = '') {
  return db_query("SELECT IFNULL(SUM(qty), 0) FROM {suggestion} WHERE ngram = :ngram", array(
    ':ngram' => $ngram,
  ))
    ->fetchField();
}