public static function SuggestionStorage::getNgramQty in Autocomplete Search Suggestions 8
Same name and namespace in other branches
- 8.2 src/SuggestionStorage.php \Drupal\suggestion\SuggestionStorage::getNgramQty()
- 3.0.x src/SuggestionStorage.php \Drupal\suggestion\SuggestionStorage::getNgramQty()
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 144
Class
- SuggestionStorage
- Database CRUD.
Namespace
Drupal\suggestionCode
public static function getNgramQty($ngram = '') {
return db_query("SELECT IFNULL(SUM(qty), 0) FROM {suggestion} WHERE ngram = :ngram", [
':ngram' => $ngram,
])
->fetchField();
}