public static function SuggestionStorage::getAllSuggestions in Autocomplete Search Suggestions 3.0.x
Same name and namespace in other branches
- 8.2 src/SuggestionStorage.php \Drupal\suggestion\SuggestionStorage::getAllSuggestions()
- 8 src/SuggestionStorage.php \Drupal\suggestion\SuggestionStorage::getAllSuggestions()
Fetch all the suggestions.
Parameters
int $start: The starting offset.
int $limit: The query limit.
Return value
array An array of suggestion objects.
1 call to SuggestionStorage::getAllSuggestions()
- SuggestionSearchForm::buildForm in src/
Form/ SuggestionSearchForm.php - The suggestion search form.
File
- src/
SuggestionStorage.php, line 37
Class
- SuggestionStorage
- Database CRUD.
Namespace
Drupal\suggestionCode
public static function getAllSuggestions($start = NULL, $limit = 100) {
if (is_numeric($start) && intval($limit)) {
return \Drupal::database()
->queryRange("SELECT * FROM {suggestion} ORDER BY ngram ASC", $start, $limit)
->fetchAll();
}
return \Drupal::database()
->query("SELECT * FROM {suggestion} ORDER BY ngram ASC")
->fetchAll();
}